CGI.pm will look among the following directories for one that is writeable to your CGI user (non-Unix directories left out):
Contents of environment variable TMPDIR
/usr/tmp
/var/tmp
/tmp
/temp
current working directory
In your case, none of the above directories seem to be writable to your CGI user.
The easiest solution is probably to set $ENV{'TMPDIR'} in your code to point to a directory that is writable to your CGI user.
CU Robartes- | [reply] [d/l] [select] |
If you have your temp dir on an unordinary place, just do this:
BEGIN { $TempFile::TMPDIRECTORY = '/mytmp' }
use CGI;
Or edit your CGI.pm in the right place:
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
# $TempFile::TMPDIRECTORY = '/usr/tmp';
--
tune | [reply] [d/l] [select] |
I don't think that this is particularly good advice. Please correct me if I am wrong, but the CGI docs clearly state that temp dirs are found in the following order:
- ~user/tmp
- $ENV{TMPDIR}
- the usual suspects (/usr/tmp, /var/tmp, C:\temp, /tmp, /temp, ::Temporary Items, and \WWW_ROOT)
I don't see any mention of it looking at the value of $TempFile::TMPDIRECTORY (whatever that might be) and I certainly wouldn't recommend anyone start hacking CGI.pm.rdfield
| [reply] |
You are right. But what if he or his sysadmin created another tmp directory, and disabled all the places, where CGI.pm looks after? I don't think that's impossible. What can he do then instead of hacking?
--
tune
| [reply] |