Sounds like your files aren’t getting uploaded properly. Maybe your script doesn’t have permission to write to the /tmp/ directory or other temp directory, so it can’t store the temporary uploaded file?
Your server error log might give you more information as to what’s going on.
All works fine, except that your “putting it all together” forgot the bin mode part. My problem lies in the temp files being created by the program. Any thoughts on deleting them?
CGI.pm should automatically remove temp upload files. However on Windows systems you might need to explicitly close the files as Windows can’t delete open files. You could try adding:
great!!! at last I could get a nice explanation about an upload file.
Could you explain another example, but using size control over the upload file and other restrictions? thanks a lot!
Tried this. upload.cgi won’t load but if I rename file to upload.pl it runs. Only thing is no picture appears in upload directory and pic also does not appear on the web page. Any ideas? r.scott@iop.kcl.ac.uk
Could be a permissions problem maybe? Make sure the webserver user has permission to create files in your “upload” directory. Also check that the path to the “upload” directory as specified in your script is correct.
I see to be having a problem with the CGI file - everything appears to be acurate, but when clicking on the submit button - it closk then gives me a “the document contains no data” error - can you help? here is a link to the test upload page: http://www.god-song.com/eupload.html
When I tried uploading a file at your site I got the error:
CGI open of tmpfile: Permission denied
Looks like your server’s CGI.pm isn’t set up with a temp directory that it can dump its temp files into. Look for the section “You can read the name of the uploaded file, but can’t retrieve the data” http://stein.cshl.org/WWW/CGI/ for some pointers.
It means that your script isn’t running correctly (usually because it has an error). Make sure you have specified the correct path to your upload folder, and also set the permissions for the folder correctly.