How to Add An Input to POST Form Specifying Content-Type
I'd like to limit my form to upload images only. I've written some javascript to check file formats, but I don't feel this is secure enough. There is no policy setting on S3 to have it deny unapproved file formats, but I've read that I can include an input in my POST form that will specify the file formats Amazon S3 should expect on POST. I'm not yet sure how this work, but I'm hoping it will result in not submitting files other than image types.
Here is the input I would like to include. Will this work as I expect? And how can I include it in the form?
Thanks & great gem!!!
At the moment this isn't possible, we would need to create another option, something like key_ends_with and pass it a regex with the endings you would like probably something in this case like jpg|jpeg|gif
You can use http://jqueryvalidation.org/accept-method#extension on https://github.com/sheerun/s3_file_field