-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
s3.headObject - where is ContentLength? #631
Comments
Added some environment details to the description |
@dirkraft if you're running this from the browser you have to ensure that you've exposed the headers you want in your CORS configuration (see the ExposeHeader field). The SDK will not be able to access any response headers that are not exposed in this way, as a CORS security restriction in your browser. |
Thanks for the quick response. This is the CORS of s3://bits.dirkraft.com as of now (just added the ExposeHeader element) <?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>300</MaxAgeSeconds>
<ExposeHeader>Content-Length</ExposeHeader>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration> curl seems(?) to see a header named Content-Length
Any more pointers? |
It's showing up in the Fiddle now for me. |
Ah it does now for me too. Fantastic. Thanks very much and keep up the great stuff |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
I'm trying to get the size of a file in S3 (from the browser) without actually downloading the entire file. It seems like
Content-Length
orresponse.ContentLength
just isn't there. Am I misunderstanding how this works?Here's a fiddle that gets a public-accessible file from S3 to show this. http://jsfiddle.net/dirkraft/9xbpoL8v/3/
Some environment details
The text was updated successfully, but these errors were encountered: