Join GitHub today
error 403 #1
I keep geting 403 errors. I thought it was related to special characters in the file name, but it happens even with the simplest filenames.
Is it possible that the problem regards the S3 Region? I'm creating all my buckets in US Standard. ¿Perhaps I should use a specific region?
I finally found that the problem lies in the parameter
In my case, the frontend was sending the file type as
For some reason, express parses it as
From then on, the provided signature was valid for a file type with a space, whereas the front was uploading a file type with a '+' sign.
@scott-laursen this is my not-so-elegant solution
note I'm using npm's atob. It's not in the core of node.js
@flyingsparx, except from my window.btoa I haven't changed much. It seems I was already using the version you linked.
Apologies for the late reply - been pretty swamped and I was unable to prioritise this any higher!
I have now removed the need for client-side dependencies. have done some pretty vigorous tests, and have not encountered any 403 errors.
@scott-laursen: The mime-type of the file set when signing the request must be the same as the mime-type set by your browser during the upload, since this value is used to re-calculate the signature on the AWS end. The latest version of the code in this repository should now address that. If the mime type cannot be automatically extracted, you will need to manually set the mine-type sent in the headers of the PUT request and that used to sign the request on the app to the same thing.