Question
I have not been able to attach files successfully. I have debugging turned on, and get the following error:
copy(/usr/tmp/CGItemp7678, /twiki/Main/user_name/twiki_test.txt) failed: No such file or directory at /home/httpd/twiki/bin/upload line 414. Status: 302 Moved location:
http://our.server.com/twiki/bin/view/Main/user_name
I believe I have something in Apache configured incorrectly, but so far, have not found anything. Suggestions appreciated. We are beginning to use TWiki regularly.
.
- TWiki version: Dec. 2000
- Web server: Apache 1.3.14
- Server OS: Red Hat Linux 6.2
Charlie Farinella
cfarinella@appropriatesolutionsPLEASENOSPAM.com
--
TWikiGuest - 18 Dec 2000
Answer
Not sure what causes the problem. TWiki prints this error message in case the copy operation fails:
# save uploaded file
my $newFile = "$tempPath/$fileName";
copy($tmpFilename, $newFile) or warn "copy($tmpFilename, $newFile) failed: $!";
For testing try to replace the copy command by a shell cp command:
`/bin/cp $tmpFilename $newFile`;
Other things to check:
- Copy source: Does the temp file created by the CGI.pm library exist? (It gets deleted when the CGI program dies)
- Copy destination: Does the topic name /twiki/Main/user_name/ exist, is it really below the pub directory, is it writable by the CGI user?
If all fails I recommend to upgrade the CGI.pm library.
--
PeterThoeny - 20 Dec 2000
I found the solution to my problem. In wikicfg.pm I had set the $pubUrlPath and the $pubDir the same. In other words I had them both set to "/twiki" without specifying the full path for $pubDir. After all, the comment reads "must match $pubUrlPath".

I would suggest the examples be set in the default setup to read:
- $pubUrlPath = "/twiki"
- $pubDir = "/home/httpd/twiki/pub"
This would work for most installations, and if not, provide a clearer example. Thanks for your help.
--
CharlesFarinella - 27 Dec 2000