nathancolgate / s3-swf-upload-plugin

A rails 3 gem which allow user upload files to S3 through an embedded flash directly. All UI has been moved out of flex and can be controlled by CSS and JavaScript callbacks.
http://www.nathancolgate.com
MIT License
318 stars 74 forks source link

Added support for different Content-Disposition headers #76

Closed jkillian closed 12 years ago

jkillian commented 12 years ago

As it was currently, the Content-Disposition header of the s3 upload request was always being set to 'attachment'. This could be bad, as someone might want to upload an image to S3 that users could view inline in the webpage. I made minor updates to the flash side and ruby side to support different values.

jkillian commented 12 years ago

Just wanted to let you know that I unintentionally stuck a small change to how the .js file is loaded into this Pull Request without mentioning it in the description. So I'll just mention it here for completeness:

Since in Rails 3.1+, all the JS files in app are compiled to one big JS file, there's no need to include a link to s3_upload.js in the view helper. In fact, this can actually throw an error, such the file won't exist in production mode (using the most common configuration settings). So, this change only includes a link to s3_upload.js if you're using a version or Rails before 3.1 I think this actually makes everything more consistent with the documentation also.