* Hal E. Fulton <hal9000hypermetrics.com> [0728 01:28]:Don't some browsers insist on looking at filetype> What's the proper way to deliver a grpahical
> file via HTTP?
> For example, supposing a web page has a bit of
> HTML like:
> <img src="http://foo.com/cgi-bin/myprog.cgi">
> Then how should myprog.cgi deliver its output?
> Is there direct support for this in one of the
> libraries, or do you just have to know how to
> do it?
> I tried just using a Content-type of image/jpeg,
> but I got garbage in the browser.
rather than mime-type?
Two workarounds spring to mind (I've installed Ruby-GD for this
very reason, but haven't tried yet):
Would this work?
<Directory /docroot/genimg/ >
Or alternatively (and haven't figured out how to do this yet)
map all requests to a particular location to your cgi
(i.e. requests to [url]http://yourserver.com/edit-img/[/url]
are mapped to [url]http://yourserver.com/cgi-bin/image.cgi[/url]
then use the trailing path_info to identify what kind of inmage to create:
will return a greyscale version of [url]http://yourserver.com/images/foo.gif[/url],
does the obvious,etc.
This is handy for existing images you need to manipulate, obviously.
As the trials of life continue to take their toll, remember that there
is always a future in Computer Maintenance.
-- National Lampoon, "Deteriorata"
Rasputin :: Jack of All Trades - Master of Nuns