SibSoft Ltd.
Development Services
software products
 RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
EZYWebhost - Cheap XUpload & XFileSharing 100% campatible hosting

AJAX upload progress bar

File sharing script
Files not copying

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload
View previous topic :: View next topic  
Author Message
sandyinc



Joined: 15 Dec 2006
Posts: 7

PostPosted: Dec 15, 2006 8:49 pm    Post subject: Files not copying Reply with quote

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?
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Dec 18, 2006 7:23 am    Post subject: Reply with quote

Sure. Damn Windows lock upload temp file, so you should use
Code:
move($temp,"$dir/$fname") || copy($temp,"$dir/$fname") || die"Can't copy file from temp dir";

instead of 'rename($temp,"$dir/$fname");' inside SaveFile2 subroutine.

As far as I remember, this is the cure for windows.
Back to top
View user's profile Send private message Visit poster's website AIM Address
sandyinc



Joined: 15 Dec 2006
Posts: 7

PostPosted: Dec 18, 2006 3:15 pm    Post subject: Reply with quote

Well, it still doesn't move it to the proper location, but at least nothing else broke...

Since I've already put so much time into this... how much work is required to upgrade to the paid version?
Back to top
View user's profile Send private message
sandyinc



Joined: 15 Dec 2006
Posts: 7

PostPosted: Dec 18, 2006 9:18 pm    Post subject: Reply with quote

*edit*

Just realized I had the path to perl wrong in the cgi file headers. Duh.

The direct copied upload_form.html works, but returns a "you are not allowed to upload files" error...

*edit-edit*

And after a quick search I found that ip_allowed oddness. Huzzah for the workingness!
Back to top
View user's profile Send private message
sandyinc



Joined: 15 Dec 2006
Posts: 7

PostPosted: Dec 19, 2006 2:24 pm    Post subject: Reply with quote

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:

Code:
[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:
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;
   }


and 369 is in:

Code:
sub getRemoteHost
{
   my $ip = shift;
   return $ENV{'REMOTE_HOST'} if $ENV{'REMOTE_HOST'};
   use Socket;     <-369
   return gethostbyaddr(inet_aton($ip), AF_INET);
}


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 Mad
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 1107
Location: Undisclosed location

PostPosted: Dec 20, 2006 6:35 am    Post subject: Reply with quote

Hmm...where did you get this XUpload source? Smile
This error happens only when Rename situation happens, just replace "$fn[$i].$ext" with "$fn.$ext" in 2 places there.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XUpload All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group