in reply to file upload (again)

Your problem is probably an old version of CGI.pm which has a broken upload() method - some of them did from memory, that's part of the reason I wrote CGI::Simple. Anyway this can't be a cut and paste of your actual code as you show an error near ""binmode but you don't go no binmode in your posted code dude. The undefined filehandle can only be $fh. Change your code to this:

$fh = $q->upload('file') or die_nice(); sub die_nice { print $q->header; print "<p>Failed again, lets look at our CGI.pm version: ", $CGI:: +VERSION print "<p>Now here is our CGI object"; use Data::Dumper; print '<pre>', $q->escapeHTML(Dumper $q), '</pre>'; exit; }

I suspect that your HTML form does not specify either multipart/form-data or POST. Show us how you call the script from the HTML please. It MUST look pretty much like this or it is never going to work:

<form method="post" action="http://mysite.com/cgi-bin/upload.cgi" enct +ype="multipart/form-data"> <p>Upload File <input type="file" name="file"> <br> <input type="submit" name="submit" value="Upload"> </form>

Other points are that you get the constants from Fcntl but don't use them (probably won't work on Windows anyway). Your filename validation is also pretty pointless

Did you follow my suggestions here?

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print