#!/usr/bin/perl -w use CGI; $query = new CGI; # let CGI.pm print the content header print $query->header; $cc = $query->param("Ccemail"); $from = $query->param("From"); $subject = $query->param("Subject"); $comment = $query->param("Comment"); $file = $query->param("Attach"); @name = split(/\\/, $file); $name = $name[$#name]; @list = $query->param("list"); $list = join(",", @list); # change the file name to include a path that # the web server can write to # e.g. the path you have in your script open(UPLOAD, ">uploaded_file.txt") or die "Sorry, cannot open $FILE: $!"; my ($data, $chunk); while ($chunk = read($file, $data, 1024)){ print UPLOAD $data; } close(UPLOAD) or die "Cannot close $FILE: $!"; # let CGI.pm help output well formed HTML print $query->start_html; print "subject: $subject
"; print "from: $from
"; print "cc: $cc
"; print "comment: $comment
"; print "Attachment: $name
"; print $query->end_html;