in reply to uploading images into cgi's

The problem here is that the client browser is expecting a data stream of type text/html, text/plain or alike and as such, when your script sends the content of the uploaded image, this content is inappropriately displayed.

To effectively address this problem, an alternate content type header, appropriate to the image data type which follows, such as image/gif, needs to be sent in place of the current header information. The appropriate content type header can be determined through use of the File::MMagic module (or the CGI::Upload module which encompasses File::MMagic in conjunction with CGI.pm to facilitate an easy interface for handling uploads).

It may be worth posting a larger snippet of your code if you would like further suggestions about how to address this problem.

 

perl -le 'print+unpack("N",pack("B32","00000000000000000000000111111100"))'