If a small image is uploaded (less than 10k), Ruby CGI seems to use a StringIO object for it. StringIO doesn''t have a #content_type method, apparently. How can I get the content type out of a small image? Thanks, Joe
Gah! Nevermind. The form I was using wasn''t multipart''d. So it was using a string, not a stringIO object. On 5/19/05, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If a small image is uploaded (less than 10k), Ruby CGI seems to use a > StringIO object for it. > > StringIO doesn''t have a #content_type method, apparently. > > How can I get the content type out of a small image? > > Thanks, > Joe >
Joe Van Dyk wrote:>Gah! Nevermind. > >The form I was using wasn''t multipart''d. So it was using a string, >not a stringIO object. > >The CGI class extends the StringIO instance with content_type and original_filename methods>On 5/19/05, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>If a small image is uploaded (less than 10k), Ruby CGI seems to use a >>StringIO object for it. >> >>StringIO doesn''t have a #content_type method, apparently. >> >>How can I get the content type out of a small image? >> >>Thanks, >>Joe >> >> >> >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > >