From: Joost Diepenmaat Date: 2005-04-21T05:05:39+09:00 Subject: Re: Newb CGI Question On Thu, Apr 21, 2005 at 04:54:24AM +0900, Michael Buffington wrote: > 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') Shouldn't that be cgi.header("image/png") { File.read('200.png'); } Or something similar? J.