CulturalMe / meteor-slingshot

Upload files directly to AWS S3, Google Cloud Storage and others in meteor
MIT License
595 stars 104 forks source link

Google Cloud Storage error: SignatureDoesNotMatch #153

Closed Hamatek closed 8 years ago

Hamatek commented 8 years ago

Error uploading: The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.

I double checked my GoogleAccessId and GoogleSecretKey I even made new one, but none work what should I do to get google Cloud Storage to work with slingshot ?

Slingshot.GoogleCloud.directiveDefault.GoogleSecretKey = Assets.getText('my-images.pem'); Slingshot.fileRestrictions("myFileUploads", { allowedFileTypes: ["image/png", "image/jpeg", "image/gif"], maxSize: 10 * 1024 * 1024 });

Slingshot.createDirective("myFileUploads", Slingshot.GoogleCloud, { bucket: Meteor.settings.GoogleCloudBucket, acl: "public-read", authorize: function () { return true; }, key: function (file) { return file.name + "/" + file.name; } });

and on the client : let uploader = new Slingshot.Upload("myFileUploads"); uploader.send(document.getElementById('file').files[0], function (error, downloadUrl) { if (error) { console.error('Error uploading', uploader.xhr.response); alert (error); } else { console.log("here is the url to see the file:",downloadUrl); } });