How do I determine the content type of the uploaded image? I have seen that the default content-type is "application/octet-stream". What if I wanted to upload a gif, bmp, jpg or other format. How will I determine which format is uploaded?
Thanks.
How do I determine the content type of the uploaded image? I have seen that the default content-type is "application/octet-stream". What if I wanted to upload a gif, bmp, jpg or other format. How will I determine which format is uploaded?
Thanks.
How do I determine the content type of the uploaded image? I have seen that the default content-type is "application/octet-stream". What if I wanted to upload a gif, bmp, jpg or other format. How will I determine which format is uploaded?
http://wiki.rubyonrails.org/rails/pages/HowtoUploadFiles
A ways down that page it says that the following will give you the content type (assuming a form with: <%= file_field "person", "picture" %>):
person['picture'].content_type
-philip