Created
February 5, 2014 16:54
-
-
Save chrisseto/8828186 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
*/ |
thanks! 👍 if anyone is curious how to get a signed url in ruby check the official gem http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#url_for-instance_method
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks again, this helped a lot