While you were gone, I cheated on you and did a frantic search on google. I ended up with this code:
Is it OK as well? How come yours is different from mine? And why does yours look so much like C++?Code:$picname = "$ENV{'QUERY_STRING'}"; $MY_FILE_NAME = $picname; $CHUNK_SIZE = 4096; open( MY_FILE, "<$MY_FILE_NAME" ) or die( "Can't open $MY_FILE_NAME: $!\n" ); print "Content-type: image/jpeg\r\n"; print "\r\n"; binmode( MY_FILE ); # These are crucial! binmode( STDOUT ); while ( $cb = read( MY_FILE, $data, $CHUNK_SIZE ) ) { print $data; } close( MY_FILE );




Reply With Quote