cinely / mule-uploader

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

Upload over https to a bucket with periods in the name #37

Closed davelassanske closed 9 years ago

davelassanske commented 9 years ago

Currently, mule-uploader is hard-coded to connect to AWS via http. I updated the script to detect whether the client is on a secure connection, and if so, make the calls to S3 over https. This works great if your S3 bucket name doesn't contain any periods. Unfortunately, mine do...it appears the solution is to use 'https://s3.amazonaws.com/BUCKET.NAME/' instead of 'https://BUCKET.NAME.s3.amazonaws.com/'.

Any insights into how to update the script or do you have the time and desire to update mule-uploader to handle this scenario?

davelassanske commented 9 years ago

A temporary fix is to set the S3 bucket to null when you instantiate mule-uploader and also in the backend signing_key method. Then add the bucket name as a folder at the beginning of the path for the 'key' config option.

gabipurcaru commented 9 years ago

I've fixed this in the latest commit -- it was just a matter of changing the S3 endpoint. I didn't test this so thoroughly, but it should correctly handle both your problems.