in reply to Re^2: How to display an image on a webpage with minimal code
in thread How to display an image on a webpage with minimal code
Wow, hold it, you're doing this too low level. You're not supposed to be doing this the NPH way, there's still a webserver between the CGI scripts and the web browser, and that one is still postprocessing the headers that the CGI script sent to it — for example, adding a content-length header for plain pages. And there's a special pseudo-header for status codes: Status:.
When I did this on Apache 2 on my laptop:
then the headers that Live HTTP Headers displayed were:print "Status: 307 Temporary redirect\n"; print "Location: " . URI->new_abs($files[int(rand @files)], "http://lo +calhost/") . "\n\n";
So the headers that got sent to the browser, are looking fine to me.HTTP/1.x 307 Temporary redirect Date: Thu, 16 Nov 2006 19:55:06 GMT Server: Apache/2.0.50 (Win32) mod_perl/1.99_16 Perl/v5.8.8 PHP/4.3.8 Location: http://localhost/images/060210-leaf.jpg Content-Length: 0 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/plain; charset=ISO-8859-1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to display an image on a webpage with minimal code
by Melly (Chaplain) on Nov 17, 2006 at 09:36 UTC |