How to Add An Input to POST Form Specifying Content-Type #51

ac360 opened this Issue Jan 30, 2013 · 2 comments

3 participants


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment