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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs