Closed doooby closed 9 years ago
You are calling presigned_url
with request type :put
and then performing an HTTP POST request:
<CanonicalRequest>POST /test22.jpg X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential= ... %2F20141221%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20141221T170842Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&x-amz-acl=public-read host:my-bucket.s3.eu-central-1.amazonaws.com host UNSIGNED-PAYLOAD</CanonicalRequest>
My understanding is that there is currently no support for generating a pre-signed POST URL. See #173.
@kabaka You are correct. I am not opposed to adding a pre-signed POST helper, but I would want to see it built around signature version 4. The v1 Ruby SDK uses the v2 S3 signature and will not work in any of the newest regions.
I'll leave here this gist I've made https://gist.github.com/doooby/2cb24eb2ea1180755c3c . It's my implementaion of simultaneous multiple images browser-based uploading to S3 using POST request with signature v4. It's build on top of this gem (aws-sdk v2.0.16.pre
) and Rails. Maybe you could embed the DirectPostHelper
class or at least use its code to add this feature.
Hello, I am trying to do a very simple direct to S3 upload funcionality, but cannot get over 403 Forbidden response.
That url I hand over to jquery's fileupload and it fails returning 403 with this xml:
The thing is, that this code on server-side goes successfuly (and the file appears in the bucket):
That's why I am sure, that everything should be set up just right. As far I've had the patience to dig into this library, I've concluded that both #upload_file and #presigned_url are using same internals for generating requisite headers/parametrs So could you point me to what's wrong?