in reply to return image from CGI scrript error

You need to binmode STDOUT and IMAGE, and add error checking
print "Expires: Fri, 30 Oct 1998 14:19:41 GMT\n"; print "Content-type:image/png\n\n"; open IMAGE, "e:/image1.png" or die "ERROR $!"; binmode IMAGE; binmode STDOUT; my ($image, $buff); while(read IMAGE, $buff, 1024) { $image .= $buff; } close IMAGE; #binmode STDOUT; #tried this with no success as well #print STDOUT $image; #tried this with no success as well print $image;

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: return image from CGI scrript error
by bear0053 (Hermit) on Oct 21, 2003 at 17:15 UTC
    thanks...it didn't work because i didn't
    binmode IMAGE;
    Good eye!