in reply to Image display problem with CGI script
I think you probably want to do something like this:
print $cgi->header( -type=>'image/jpeg', -attachment=>$jpegFile); open( JPEG, $jpegFile ) || die "Unable to open $jpegFile for read: $!"; my $buffer; while ( sysread( JPEG, $buffer, 65536 ) ) { print $buffer; } close(JPEG);
Update: Corion and are disagree about whether a binmode is required .. anyone? Anyone?
Update 2: Corion pointed out that under Win32, binmode will be required .. but that's on the server, not on the client, since it's on the server that the CGI is being run. I forget that because I've been programming under Linux for the last five years -- binmode isn't required there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Image display problem with CGI script
by Roger (Parson) on Dec 13, 2003 at 01:00 UTC | |
|
Re: Re: Image display problem with CGI script
by Anonymous Monk on Dec 12, 2003 at 20:22 UTC |