TTLabs / EvaporateJS

Javascript library for browser to S3 multipart resumable uploads
1.82k stars 207 forks source link

Make it clear that <ExposeHeader>ETag</ExposeHeader> needs to be added to the bucket's CORS config for multipart to work #426

Open thomas-profitt opened 5 years ago

thomas-profitt commented 5 years ago

I hit this same snag as in https://github.com/TTLabs/EvaporateJS/issues/410 and possibly https://github.com/TTLabs/EvaporateJS/issues/365

The issue isn't that the responses to the PUT requests are missing their XML bodies, but that they're missing their ETag headers.

The solution for me was to add <ExposeHeader>ETag</ExposeHeader> (not to be confused with AllowedHeader, and that's ExposeHeader, not ExposedHeader) to my bucket's CORS configuration, as described here: aws/aws-sdk-js#191

Because I had to enable logging, search through evaporate.js and add breakpoints in order to find what was wrong and what to do, I think this needs to be made clear in documentation about using evaporate.js, and that a check should be added here to spit out a big obvious error in the console letting the developer know what's wrong and how they can fix it.

jakubzitny commented 5 years ago

It's in wiki: https://github.com/TTLabs/EvaporateJS/wiki/Configuring-The-AWS-S3-Bucket. Anything missing there?

thomas-profitt commented 5 years ago

Because my bucket's CORS configuration was already permissive, I didn't notice the section.

That it's in the documentation solves the majority of the problem. When Evaporate tries to get the ETag header, and it's missing, though, it should log meaningful error output that makes the problem and solution clear.

jakubzitny commented 5 years ago

You're welcome to submit a PR for that :wink: