I'm running the free version on XP to test and I'm having some issues. (yes, I know XP + free = broken)
The main issue I'm having is that its not copying the files to the directory stated for target_dir. The upload works fine, the progress bar is great, but I just end up with a folder in the temp directory with the unique ID and a CGItempxxxxx file.
This file, when re-named to the correct file name is the exact file its supposed to be, but the script isn't doing this automatically. The dir paths are correct, with the proper privileges (near as Windows can get), and every other part works...
Another issue is to be able to change the upload dir dynamically based on form data passed to it, but I think I saw a solution to that in another thread.
Any ideas?
XUpload - Files not copying
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Sure. Damn Windows lock upload temp file, so you should use
instead of 'rename($temp,"$dir/$fname");' inside SaveFile2 subroutine.
As far as I remember, this is the cure for windows.
Code: Select all
move($temp,"$dir/$fname") || copy($temp,"$dir/$fname") || die"Can't copy file from temp dir";
As far as I remember, this is the cure for windows.
New day, new errors: Upon attempting to upload, it appears that nothing happens and I get an error in the browser that says there is a syntax error on character 1 of line 2 (which happens to be the < of the <html> tag). After inspecting the Apache logs, I find this:
lines 165 and 167 are in this block:
and 369 is in:
I'm a bit lost on this. How could it error on lines 165 and 167 because of $fn if it uses that same variable in line 162 to get to that part of the script?
Also, I'm getting an error for files that aren't already in the directory, but this is telling me its a problem with the xupload.js file where it doesn't know what ext_allowed is. Maybe its a problem with XUploadConfig.pm ?
It just drives me nuts because it worked great before I went home last night and this morning I get this
Code: Select all
[Tue Dec 19 08:50:04 2006] [error] [client 127.0.0.1] [Tue Dec 19 08:50:04 2006] upload.cgi: Global symbol "@fn" requires explicit package name at C:/Program Files/Apache Group/Apache2/cgi-bin/upload.cgi line 165., referer: http://localhost/PORTAL/file_management.html
[Tue Dec 19 08:50:04 2006] [error] [client 127.0.0.1] [Tue Dec 19 08:50:04 2006] upload.cgi: Global symbol "@fn" requires explicit package name at C:/Program Files/Apache Group/Apache2/cgi-bin/upload.cgi line 167., referer: http://localhost/PORTAL/file_management.html
[Tue Dec 19 08:50:04 2006] [error] [client 127.0.0.1] [Tue Dec 19 08:50:04 2006] upload.cgi: BEGIN not safe after errors--compilation aborted at C:/Program Files/Apache Group/Apache2/cgi-bin/upload.cgi line 369., referer: http://localhost/PORTAL/file_management.html
lines 165 and 167 are in this block:
Code: Select all
if(-e "$c->{target_dir}/$fn.$ext" && $c->{copy_mode} eq 'Rename')
{
my $i;
$i++ while (-e "$c->{target_dir}/$fn[$i].$ext" && $c->{copy_mode} eq 'Rename'); <-165
$fhash{file_status}="renamed";
&lmsg("MSG:'$fn.$ext' ".$c->{msg}->{already_exist}." '$fn[$i].$ext'."); <-167
$fn.=$i;
}
Code: Select all
sub getRemoteHost
{
my $ip = shift;
return $ENV{'REMOTE_HOST'} if $ENV{'REMOTE_HOST'};
use Socket; <-369
return gethostbyaddr(inet_aton($ip), AF_INET);
}
Also, I'm getting an error for files that aren't already in the directory, but this is telling me its a problem with the xupload.js file where it doesn't know what ext_allowed is. Maybe its a problem with XUploadConfig.pm ?
It just drives me nuts because it worked great before I went home last night and this morning I get this
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm