waynehoover / s3_direct_upload

Direct Upload to Amazon S3 With CORS
MIT License
652 stars 333 forks source link

Do not send empty content-type to S3 #207

Closed tolingo-dev closed 9 years ago

tolingo-dev commented 9 years ago

Hi guys,

we encountered a problem with *.idml files. In the browsers the file.type is the empty string ''. Hence, S3 is sent

------WebKitFormBoundary....
Content-Disposition: form-data; name="content-type"

------WebKitFormBoundary....
Content-Disposition: form-data; name="file"; filename="example.idml"
Content-Type: application/octet-stream

which causes S3 to interpret this as a .zip file. When later downloading the "example.idml" from S3 one is presented with a "example.idml.zip" file. Not setting the content-type, if it is the empty string, fixes this.

(Fixed two non-related specs as well for a happy Travis-CI :))

janraasch commented 9 years ago

Sorry for the noise. Wrong user... ;)