-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing the Location header returned by AWS #150
Comments
Out of the box, the Is there a reason you're not getting the URL from the XML payload? Looking at the headers versus the XML, the
If you do need the actual headers, you'd have to extend the S3 Uploader and provide a new |
Thanks, I will try this method and pull out the location URL from the xml via the
|
I ran into a similar issue, S3 was returning an empty document with a 204 status code. Setting def sign
...
obj = resource.bucket(ENV['AWS_S3_BUCKET'])
.object("uploads/#{params[:name]}")
.presigned_post(
acl: 'public-read',
expires: expires,
+ success_action_status: '201'
)
...
end |
Please note the returned location header is encoded in a strict version where spaces are replace with Not sure why S3 does this since spaces are allowed in HTTP headers and the description in the API documentation does not explain Anyway, I suggest simply adding a replace like this if you want the fully decoded URI : decodeURIComponent(response.headers.location.replace(/\+/g, ' ')) Edit: kind of official response of AWS on the |
When uploading to S3 is there anyway to gain access to the header named
Location
which it returns containing the url encoded path to the file just uploaded?The text was updated successfully, but these errors were encountered: