cinely / mule-uploader

Stubborn HTML5 Amazon S3 uploader
http://mule-uploader.com/
MIT License
223 stars 43 forks source link

content-type is always "binary/octet-stream" #20

Closed kookster closed 10 years ago

kookster commented 10 years ago

In the initiate multipart request to AWS, there is no content type header sent.

Even though the content type is sent in each chunk and in the finalize multipart AWS requests, this is insufficient to set the content-type on the object in s3; it always has the initial value, the default, "binary/octet-stream".

I'll work on a pull request for this (I have it working in my app), essentially the content-type needs to be sent in the initiate POST here: https://github.com/cinely/mule-uploader/blob/master/mule-uploader.js#L292

and the backends all have to include the content-type/mime-type in the signature: https://github.com/cinely/mule-uploader/blob/master/example_backend.py#L76 https://github.com/cinely/mule-uploader/blob/master/php_backend/example_backend.php#L98-L100 https://github.com/cinely/mule-uploader/blob/master/ruby_backend/example_backend.rb#L146

gabipurcaru commented 10 years ago

I know you said you'd add a pull request, but the code is changed dramatically now and I've just fixed this. Thanks for letting me know about this!