in reply to return image from CGI scrript error
print "Expires: Fri, 30 Oct 1998 14:19:41 GMT\n";
Hrm, you're sending an Expires date of about five years ago. Just how that will be handled is probably browser-specific, but I suspect this is your problem. Don't hardcode the expire data. Instead, use Date::Manip (or a similar module) to add a certain ammount of time to the current data.
Also, you're creating more work for yourself and using memory unnecessarily. Instead of buffering the image, print it out as you get it:
open IMAGE, "e:/image1.png"; my $buff; while(read IMAGE, $buff, 1024) { print $buff; } close IMAGE;
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
:(){ :|:&};:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: return image from CGI scrript error
by bear0053 (Hermit) on Oct 21, 2003 at 16:05 UTC | |
by hardburn (Abbot) on Oct 21, 2003 at 16:10 UTC |