Anybody know off the top of their head when the ->upload("file") function of CGI.pm came into play?
We've been attempting to get a simple file upload script to work, which does work as expected on Verio's hosting farm (which has Perl 5.6 installed). But, when we try placing this on an EarthLink hosted domain site, one line chokes the whole thing. Ironically, that one line is the one that is pretty darn important to uploading a file from a webform, see line 4 in the below sample. 01 #!/usr/local/bin/perl 02 use CGI; 03 my ($query) = new CGI; 04 my $upfile = $query->upload("upfile"); 05 my $upfile_name = $query->param("upfile"); 06 my $destPath = "../uploads/$upfile_name"; 07 if(open(UPLOADFILE, ">$destPath")) { 08 while (my $bytesread = read($upfile, my $buffer, 1024)) { 09 print UPLOADFILE $buffer; 10 } 11 close (UPLOADFILE); 12 } 13 exit; If this script is run on the EarthLink server with line 4 commented out, it runs through successfully, excepting the fact that it doesn't actually upload a file, just creates "../uploads/upfile_name" as a 0Kb file. If line 4 is left uncommented, then we get 500 errors from the server complaining about it. I'm curious if the version of Perl installed on EarthLink's servers is simply older than that installed on Verio's and if it is old enough for the upload function to be unsupported. Or, perhaps the upload function is somehow disabled by EarthLink?