I have got into almost every resource on the topic, but still need your help to make this work. I want to directly upload files to my S3 directly from the browser in my Meteor a
To get this working I had to add a couple of parameters to the s3.getSignedUrl
call:
ContentType: mimeType,
Body: '',
"ACL": 'public-read'
Full method:
Meteor.methods({
requestUpload: function(filename, mimeType) {
var fut = new Future();
new Fiber(function() {
var params = {
Bucket: MY_BUCKET,
Key: new Date().getTime() + "_" + filename,
ContentType: mimeType,
Body: '',
"ACL": 'public-read'
};
var surl = s3.getSignedUrl('putObject', params, function(err, surl) {
if (!err) {
console.log("signed url: " + surl);
fut.return(surl);
} else {
console.log("Error signing url " + err);
fut.return();
}
});
}).run();
return fut.wait();
}
}