I've been able to use Mongrel's native API to serve up files using:

response.start do |head, out|
 head['Content-Type'] = resource.content_type
 out.write( resource.content )
end

This has worked well, until I attempted to serve up images.
resource.content seems to be the problem.  Usually it returns the text of
the page.  When resource.content returns an image, I've noticed that Mongrel
doesn't set the Content-Length header to the correct length for the image.
All other headers seem to be valid.

I tried passing the filename of the image using out.send_file, but it seems
as though send_file is no longer available.

What method should be used for returning binary content such as images?

--
Dennis Sutch
[EMAIL PROTECTED]
_______________________________________________
Mongrel-users mailing list
Mongrel-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-users

Reply via email to