Indomitus has asked for the wisdom of the Perl Monks concerning the following question:
Thanksmy $size = (-s $filename); # get extension for mime type $filename =~ m/\.([^.]+)$/; my $image_type = "image/$1"; print $cgi->header( -Content_Type => "$image_type", -Content_Disposition => "attachment; filename=$filename", -Content_Length => $size, -Expires => 'now', ); open(IMG, "<$filename") || die "Cannot open file: $!"; # not needed under linux ?? binmode(IMG); while( <IMG>) { print; }; close(IMG);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Displaying image to IE problem
by Ovid (Cardinal) on Mar 21, 2002 at 21:23 UTC | |
|
(cLive ;-)Re: Displaying image to IE problem
by cLive ;-) (Prior) on Mar 21, 2002 at 22:05 UTC |