Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ctaylor/9631238 to your computer and use it in GitHub Desktop.
Save ctaylor/9631238 to your computer and use it in GitHub Desktop.
uploadMethod: 'PUT',
uploadAdded: function(file, item) {
//Recieve the signed PUT request here
//I can create another GIST if anyone would like the code for signing the requests
mydropzone.options.url = url;
},
uploadSending: function(file, formData, xhr) {
xhr.setRequestHeader('Content-Type', file.type || 'application/octet-stream');
xhr.setRequestHeader('x-amz-acl', 'private');
}
/*
Cors config for your bucket:
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
The * can be changed out, I just didnt feel like recording all the additional headers
If allowed origin is managed properly having a wild card for headers should not be an issue
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment