I’ve been trying to setup dropzone with slingshot for a coupe of days now.
Slingshot.createDirective('upload', Slingshot.S3Storage, {
bucket: 'myBucket',
maxSize: 1024 * 1024 * 1,
region: 'eu-west-1',
AWSAccessKeyId: Meteor.settings.server.AWS.AccessKeyId,
AWSSecretAccessKey: Meteor.settings.server.AWS.SecretAccessKey,
allowedFileTypes: ['image/png', 'image/jpeg', 'image/gif'],
authorize: function() {
if (!this.userId) {
var message = 'Please login before posting files';
throw new Meteor.Error('Login Required', message);
}
return true;
},
key: function(file) {
return 'uploads/' + file.name + '_' + Date.now();
}
});
Template:
Template.dropzoneArea.onRendered(function(){
if (Meteor.isClient) {
Dropzone.autoDiscover = false;
var dropzone = new Dropzone("form#dropzone", {
accept: function(file, done) {
var uploader = new Slingshot.Upload('upload');
uploader.send(file, function (err, downloadUrl) {
if (err) {
console.error('Error uploading', uploader);
} else {
console.log('success: ' + downloadUrl);
}
});
}
});
}
});
[package: https://atmospherejs.com/dbarrett/dropzonejs]
The upload to amazon s3 works fine.
But the ui behavior of dropzonejs is not working correctly (eg. the progressbar and the success check symbol).
Any ideas on how to get that working?