Hi,
Is it possible to set the upload destination folder as a variable during the upload...
I have a real estate website and my "uploads" folder structure has the following subfolders: "images", "vr_tours", "documents"
How can I tell the script to upload new images to "images" folder, new vr tours to "vr_tours" folder, etc?
Thank you,
Regards,
Roman
XUpload - Upload to multiple locations
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Hey
Hey, i'm using the free version and would also like to specify the folder location via GET or POST, i even found how to read GET and POST using PERL. What i tried to do is find the GET data before including the XUploadConfig.pm file which used $name for the target directory. the path was stored into $name, but I guess the upload doesn't work this way.
I'm new to PERL and only needed an upload script with no limitations and a progress bar. XUpload seemed like the best choice, and so far is, but i need to specify user specific upload directories for a per user basis.
I've scoured these forums to find no such hack given for free, but maybe if i post the "modifications" i made, you can tell me if i'm right/wrong?
All i really need to know is how to read POST data in the upload.cgi.
Also, if i want to upload two files in one form, but the free version only allows one, can i still upload the second file via PHP (after sending all POST/GET data to PHP script after PERL upload?)
Thanks for your time!
I'm new to PERL and only needed an upload script with no limitations and a progress bar. XUpload seemed like the best choice, and so far is, but i need to specify user specific upload directories for a per user basis.
I've scoured these forums to find no such hack given for free, but maybe if i post the "modifications" i made, you can tell me if i'm right/wrong?
All i really need to know is how to read POST data in the upload.cgi.
Also, if i want to upload two files in one form, but the free version only allows one, can i still upload the second file via PHP (after sending all POST/GET data to PHP script after PERL upload?)
Thanks for your time!
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Ok. Here goes quick hack for specific upload folder:
you need to create input field with name 'ext_folder' in your upload form containing sub-folder name where you want upload to.
e.g. <input type="hidden" name="ext_folder" value="users">
then in your upload.cgi find line: "my @params = $cg->param;" and add this code below:
About 2 files upload: no, it's not possible to upload 2nd file with PHP
you need to create input field with name 'ext_folder' in your upload form containing sub-folder name where you want upload to.
e.g. <input type="hidden" name="ext_folder" value="users">
then in your upload.cgi find line: "my @params = $cg->param;" and add this code below:
Code: Select all
my $ext_folder = $cg->param('ext_folder');
$ext_folder='' if $ext_folder=~/\.\./;
$c->{target_dir}.= "/$ext_folder" if $ext_folder;
About 2 files upload: no, it's not possible to upload 2nd file with PHP
Thankyou very much!, i was trying to do soemthign similar but had no idea how to grab POST data in PERL
Is there a way to specify if the uploading file should redirect to a new page? Say i want to create a way to upload multiple files myself by using Javascript, can i add a GET command to the script to tell it to redirect to a new page if the new var is equal to 1?
Thank you soo much!
Is there a way to specify if the uploading file should redirect to a new page? Say i want to create a way to upload multiple files myself by using Javascript, can i add a GET command to the script to tell it to redirect to a new page if the new var is equal to 1?
Thank you soo much!
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm