I'm trying to make a CGI script to upload files remotely onto my server, to get around my uni blocking everything but port 80, but I have ran into a problem with it. I followed the documentation on CPAN for uploading files and did what they have suggested as the best way but it doesn't work. Here is my code:
#!/usr/bin/perl use warnings; use strict; use CGI ':standard'; #Declare any variables my $radio_button; my $filename; #Generate the form print header; print start_html ("File Uploader v3"); print "<h1>File Uploader</h1>\n"; print "<hr>\n"; print "<p>Which file type: </p>"; print radio_group(-name=>'File_Type', -values=>['HTML', 'CGI'], -default=>'HTML'); print start_multipart_form(); print "<p>File Upload: </p>"; print filefield (-name=>'Uploaded_file', -default=>'Give a file', -size=>'50'); print "<br><br>"; print submit('Upload', 'Upload'); print reset; print endform; #Do the work $radio_button = param('File_Type'); if ( $radio_button eq "HTML" ) { $filename = upload('Uploaded_file'); open (OUTFILE, ">>/tmp/uploaded.html") || die "Can't open the file: $!"; while (<$filename>) { print OUTFILE $_; } close (OUTFILE); open (MAIL, "|mail -s \"File Uploaded\" vendion"); print MAIL "A file has just been uploaded!\n"; close (MAIL); } else { #Code soon to come } print end_html; Running it locally prints out the generated HTML and it looks right and the page does open correctly on my server but there is not file in /tmp and the mail is never sent and I don't know if it is a problem with opening the OUTFILE handle because the die command doesn't kick in from what I can see. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/