XUpload - I need 2 differnt types of images & seprate folders for

Message
Author
vinayn
Posts: 11
Joined: May 14, 2007 10:09 pm

I need 2 differnt types of images & seprate folders for

#1 Postby vinayn » May 23, 2007 6:43 pm

Hi,

I have two different set of types of images to be uploaded on same form.
and separate folders for each type of images. :?:
thanks
Vinay

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

#2 Postby PilgrimX182 » May 24, 2007 5:05 am

Congratulations! :)

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

#3 Postby PilgrimX182 » May 24, 2007 5:16 am

Actually it's possible to do with quick hack: in upload.cgi find

Code: Select all

my ($fn,$ext) = $filename=~/^(.+)\.(.+)$/;
and add below it:

Code: Select all

$c->{target_dir} = lc($ext) eq 'jpg' ? '/full/path/upload_dir1' : '/full/path/upload_dir2';
so when extension is jpg, target dir will be upload_dir1, if another extension, then upload_dir2