Filepicker.io bombards on upload to S3 in Meteor app
I am working on a file loader for my application and I settled on Filepicker.io. Everything works fine except for one. When I upload an image to S3, I can only upload the URL that the Filepicker returns (not the image itself).
Below is done successful but
Template.new_aphorism.events({
'change #attachment': function(event){
var savedFile = JSON.stringify(event.fpfile);
var parsedJSON = eval('('+savedFile+')');
var url=parsedJSON.url;
$('input[name=new_aphorism_image]').val(url);
console.log("saved file is:" + savedFile);
console.log(url);
filepicker.store(url, {location: 'S3'}, function(fpfile){
output.html('Uploaded: '+fpfile.filename+'');
}, function(fperror){
output.text(fperror.toString());
}, function(progress){
output.text("Uploading... ("+progress+"%)");
});
}
});
I am returning as a message:
File stored in S3 at VnAa2YsOS6wOECNMWpwn_temp.txt and available at https://www.filepicker.io/api/file/vVtWTOl7QqOJ7gPmXkHQ
I've tried passing this
it event.fpfile
to my filepicker.store function as well, but it just doesn't work.
+3
source to share