XUpload - XUpload Free Multi user

Posts: 2
Joined: Sep 21, 2008 2:26 pm

XUpload Free Multi user

#1 Postby pc_helferlein » Sep 21, 2008 2:40 pm

How to change the settings in the XUpload pro if you use php and wanne redirect the uploaded File into the users directory?

I already did it once, but for a certain reason i wasn't able to figure out yet, in a new framework the XUpload free refuses to do so.
Ich got the username in $_SESSION['user'] and the upload form itself is secured in a php document which only can becalled from another file. If someone tries to open the file directly the server blocks him and tells him to log in.

Unfortunately the uploader keeps sending the files in /pub instead of /pub/username.

Got any idea on how to get it fixxed again?
I find the bar very useful and it already saved me a lot of time and preserved me from getting grey hairs in university. The block all regular uploads, but luckily the uploader in the old framework did it perfectly.

What to switch wehere to get it back the way it was working?

Kind regards

Hey keep the great work up i like the Upload progress bar :)

User avatar
Posts: 2187
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Sep 22, 2008 9:51 am

FREE xupload NEVER was able to upload to specific folder!

But if you wanna to save to specific user folder, edit this line in upload.cgi:

Code: Select all

&SaveFile2( ${$cg->{'.tmpfiles'}->{$k}->{name}}, $c->{target_dir}, $filename );


Code: Select all

&SaveFile2( ${$cg->{'.tmpfiles'}->{$k}->{name}}, "$c->{target_dir}/".$cg->param('username'), $filename );

and add hidden field to upload form:

Code: Select all

<input type="hidden" name="username" value="my_username">

Posts: 2
Joined: Sep 21, 2008 2:26 pm

#3 Postby pc_helferlein » Sep 23, 2008 8:53 am

Although XUpload never was supposed to do a multi user upload it easily can be told to do so thanks to the clear and efficient code of yours.
Man your doin a real great job with your scripts keep it up.
You earned my respect.

Kind regards

Return to “XUpload”