Hello !
I am trying to upload some images to AWS when I return from a Meteor method call.
So far I wrote this :
Meteor.call("insertNewAd", dataToBeInserted, function(error, result){
if(error){
console.log("Error while occurred in db", error);
}
if(result){
console.log("Insertion sucessful " + result);
var fileObj = new FS.File();
console.log("step1");
fileObj.attachData(dataToBeInserted.urlImages[0]);
console.log("step2");
Files.insert(fileObj);
console.log("step3");
}
});
However this fails (after step1) with the error :
Exception in delivering result of invoking 'insertNewAd':
fsFileAttachData@http://localhost:3000/packages/cfs_file.js?246cf3116c9b9839564e22bd58f735e95bcbcb59:116:1
Please note that the image is on a remote server and submitted to same origin policy. However from cfs documentation :
Note that when you pass a URL on the client, the actual data download
from that URL happens on the server, so you don’t need to worry about
CORS.
I am not restricted on CollectionFS, so there is another solution, I will take it
Thank you !