
localfilmmaker
stranger
Apr 23, 2001, 2:10 PM
Post #8 of 9
(325 views)
|
Ok, now we're gettinh somewhere. I looked at your html and your perl, and I think I have found where things are breaking down. In your HTML page you have: <INPUT TYPE="FILE" NAME="file"> But in your cgi script you have: $upload = param('upload'); This is looking for a cgi field with the name "upload", but there isn't one in your form, yours is named "file". So, all you would have to do is change your files so that they are both talking about the same cgi field. This is also why you got all those error messages. From your cgi script: $upload = param('upload'); #---This parameter doesn't exists, so $upload is an empty string "" $name = "$upload"; # $name is now an empty string $name =~ s!^.*(\\|/)!!; # still an empty string $file = param('upload'); # Same thing as with $upload, $file is an empty string $file =~ m!([^/:\\]*)$!; # This won't match anything, because $file is empty $short_name = $1; # There was no match above, so $1 is undef, therefore $short_name is undef open (SAVE,"/$UploadDir/$short_name"); #WARNING- using $short_name when it doesn't have # a value. Therefore, this open statement will fail and the file handle SAVE won't be open binmode(SAVE); while ($size = read($file,$data,1024)){ print SAVE $data; # This will give an error every time it tries to write to SAVE, because # SAVE isn't open $total_size += $size; } -localfilmmaker Spencer Christensen spencer@mecworks.com
|