Hello All, I created a simple http upload file routine that uploads file into my accounts sub folder uploads, "/home/myaccount/uploads". This is already running.
Now what I wanted to do is retrieve the uploaded file from the browser, and display the content in the browser if it is an image or a text/html file, if not then download it. I made a simple code and its not working for the image file, I hope someone here in the list can help me. Here are the sample code that I've tried so far and it didn't work. Kindly please tell me what I missed.... Code 1: It didnt work... #!/usr/bin/perl use CGI; $query = new CGI; my $filepath='/home/myaccount/uploads/laptop.jpg'; print $query->header('image/jpeg'); print $filepath; Code 2: This code is running ok with text/html files, but not with the images, I hope someone here can help me. #!/usr/bin/perl my $filepath="/home/rce/uploads/drugs.jpg"; open(IMAGE, $filepath); binmode IMAGE; print "Content-type: image/jpeg\n\n"; while(<IMAGE>){ print; } Thanks in advance Archie -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]