#!/usr/bin/perl use CGI qw(:standard); $q = new CGI; if ($q->param) { # Get File Name my $file = param('file_upload'); # Reformat the file_name my $file_name = "/home/sve204/public_html/ppm_summer06/screencapture.jpg"; # Open a filehandle if (open(NEW, ">$file_name")) { # Read the file while (read($file, $buffer, 1024)) { # Write to the file print NEW $buffer; } close NEW; } else { print "Content-type: text/html \n\n"; print "Sorry, there was an error and we could not save the file."; print $file_name; exit 0; } print "Content-type: text/html \n\n"; print "It worked"; } else { print "Content-type: text/html \n\n"; print "Sorry, there was no file uploaded."; exit 0; } #exit 0;