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 yourserver.com
are mapped to yourserver.com
)
then use the trailing path_info to identify what kind of inmage to create:
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
What’s the proper way to deliver a grpahical
file via HTTP?
with mod_ruby:
image is an object with such methods:
image.mime-type → image/jpeg, image/png, image/gif - depending on image
image.content → binary content of picture
I tried just using a Content-type of image/jpeg,
but I got garbage in the browser.
Don’t some browsers insist on looking at filetype
rather than mime-type?
What do you mean by “filetype”? Do you mean “extension”? It shouldn’t make
any different. If the server sends back
Content-type: image/jpeg
then where is the filename to be found in the response? The browser could
look at the source URL (/foo/bar/baz.cgi) but that doesn’t tell it anything
about the type of the response.
I’ve written CGIs which spit out jpeg’s and they’ve worked, so I think it’s
likely to be some other trivial problem. Post the URL here and we can test
it using telnet to port 80…
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 yourserver.com
are mapped to yourserver.com
)
I tried just using a Content-type of image/jpeg,
but I got garbage in the browser.
Don’t some browsers insist on looking at filetype
rather than mime-type?
What do you mean by “filetype”? Do you mean “extension”? It shouldn’t make
any different. If the server sends back
Content-type: image/jpeg
then where is the filename to be found in the response? The browser could
look at the source URL (/foo/bar/baz.cgi) but that doesn’t tell it anything
about the type of the response.
I’m talking about the extension.
And some versions of IE. So laws of logic don’t apply
On Fri, Jul 18, 2003 at 07:28:42PM +0900, Rasputin wrote:
–
A successful [software] tool is one that was used to do something
undreamed of by its author.
– S. C. Johnson
Rasputin :: Jack of All Trades - Master of Nuns