Slingshot.createDirective("myFileUploads", Slingshot.S3Storage, {
AWSAccessKeyId: Meteor.settings.private.s3.AWSAccessKeyId,
AWSSecretAccessKey: Meteor.settings.private.s3.AWSSecretAccessKey,
bucket: "bucket_name",
acl: "public-read",
authorize: function () {
//Deny uploads if user is not logged in.
if (!this.userId) {
var message = "Please login before posting files";
throw new Meteor.Error("Login Required", message);
}
return true;
},
key: function (file) {
//Store file into a directory by the user's username.
return "test/" + file.name;
}
});
If you aren’t seeing anything in console for this.uploader.progress() then you must have the Slingshot object attached somewhere else. I think you need to attach the slingshot object to the Template to be able to use that exact line of code… I am not certain though, I am not on my dev machine so I can’t test for you either sorry!
It gives ryanswrt:autoform-slingshot lots and lots of improvements. Such as support for ionic, multiple directives per upload, i18n, no more hacks going on and more improvements.