Does anyone know how to set a simple js Object to Parse.Object's field with type 'file' and save it successfully?
I have a model like
{...
picture: 'file',
...
}
I upload a file via server side and get an {name,url} object. Send it to front-end as JSON. After that I'm trying to use this JSON as picture
{...
picture: {name,url},
...
}
via POST request to the server(model.save(params)) but have just
{ code: 111,
message: 'Invalid file url: "http://s3.amazonaws.com/files.parsetfss.com/4d46bc83-d162-4d44-8462-d695f008f787/tfss-8c096482-2b88-4509-a99c-4c99ae57d51d-cat.jpg"' }
There is an approach without duplicate pictures like Cloud Code: Creating a Parse.File from URL?