From: Michael Buffington Date: 2005-04-21T04:54:24+09:00 Subject: Newb CGI Question So I thought I had CGI in Ruby figured out, but I'm stumped on the following: I want use Ruby to dynamically serve an image. The image tag would look like , where 200 is the id for an image. So here's what I have (I'm trading embarrassment for guidance): require "cgi" cgi = CGI.new("html4") cgi.out('image/png') File.read('200.png') Now, I'm pretty sure I'm not reading the file right, but what I seem to be stuck on first is getting my MIME type right. When hitting the CGI, I can't get Content-Type to come back as 'image/png'. It's always 'text/html'. Any tips?