Hi,
Congratulations for your work, it's pretty awesome !
Let me drop a quick explanation first : My company is hosting several websites, dedicated to audiovisual archive managment.
Each site has specific directories, design, etc, though they share the same core (PHP libs, upload components, etc).
Obviously, the destination directory for uploads is different for every client. Moreover, we use the upload for different purposes for each client, ending in several configs and allowed file types (movies / documents / storyboard, etc).
And additionnally, our software is multilingual.
So I'd like to know :
1. If there is a possibility to specify dynamically one xUploadConfig file to use ?
2. If there is a possibility to put this config file elsewhere than in the cgi-bin (ie in the client specific directories for us) ?
3. Or if it is possible to pass dynamically the params found in the xUploadConfig (destination, file type, sizes, redirection) ?
I'm a pretty skilled PHP programmer, but I'm a ignorant in CGI/PERL, so I prefer to ask you first.
Thanks a lot !
Loïc
XUpload - Multiple param files or dynamically pass parameters ?
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Thanks Loïc,
in XUpload Pro in config there is recent feature that allow to define several custom configs and only specify config ID in upload form hidden field. So you can use One same config file with some subconfigs inside. You can define custom upload folders, size limits, allowed filetypes, POST URL there.
I think this will work for you.
Art
in XUpload Pro in config there is recent feature that allow to define several custom configs and only specify config ID in upload form hidden field. So you can use One same config file with some subconfigs inside. You can define custom upload folders, size limits, allowed filetypes, POST URL there.
I think this will work for you.
Art
Thanks,
Yes, I saw the xmode parameter in both the forms and the config files, but this can't be a reliable solution for me.
Technically this could do the trick but in term of maintenance this could lead to many problems.
Multiply our upload types by our clients and by our supported languages and you've got a huge config file to manage where any mistake can have pretty hard consequences for us.
Moreover, we plan to let our new clients to automatically create accounts
and I don't see any solution here for the param file.
So, my question seems to end to a new feature request :
- Have multiple config files, being located elsewhere than in the cgi-bin.
AND/OR
- Pass parameters dynamically (by POST for example, like you did with the destination directory).
To my opinion, the second one seems to be quite handy and inevitable in the future.
Regards and thanks for the quick reply and for the efforts you put in Xupload
Loic
Yes, I saw the xmode parameter in both the forms and the config files, but this can't be a reliable solution for me.
Technically this could do the trick but in term of maintenance this could lead to many problems.
Multiply our upload types by our clients and by our supported languages and you've got a huge config file to manage where any mistake can have pretty hard consequences for us.
Moreover, we plan to let our new clients to automatically create accounts
and I don't see any solution here for the param file.
So, my question seems to end to a new feature request :
- Have multiple config files, being located elsewhere than in the cgi-bin.
AND/OR
- Pass parameters dynamically (by POST for example, like you did with the destination directory).
To my opinion, the second one seems to be quite handy and inevitable in the future.
Regards and thanks for the quick reply and for the efforts you put in Xupload
Loic
Next step of my adventures, might be useful for someone, who knows ? :
First, I've modified the script
with
This allows to use a form field "url_post" to redirect after upload.
I didn't want to use the 'ext_folder' param to specify the destination, as I consider this to be quite unsecure.
BTW, to hide the destination dir also after redirection, I've removed the line
At last, I've discovered in Apache the command
It allows cgi to be executed outside the regular cgi-bin directory provided you add the ExecCGI Option for every directory containing cgi scripts.
I've removed xUpload from our generic cgi-bin dir and put it in every website / subdomain we host.
As everything in xUpload uses relative path (BIG thanks !) it works flawlessly.
The little price to pay is the redundancy between script files but now, I have the specific solution I wanted. I can even change the look'n'feel for every client if asked.
I hope this could help someone a day...
Regards.
First, I've modified the script
Code: Select all
my $url_post = $c->{url_post} || $ENV{HTTP_REFERER} ;
Code: Select all
my $url_post = $c->{url_post} || $cg->param('url_post') || $ENV{HTTP_REFERER} ;
I didn't want to use the 'ext_folder' param to specify the destination, as I consider this to be quite unsecure.
BTW, to hide the destination dir also after redirection, I've removed the line
Code: Select all
push @har, { name=>'target_dir', value=>$c->{target_dir}, 'style'=>2 };
Code: Select all
AddHandler cgi-script .cgi
I've removed xUpload from our generic cgi-bin dir and put it in every website / subdomain we host.
As everything in xUpload uses relative path (BIG thanks !) it works flawlessly.
The little price to pay is the redundancy between script files but now, I have the specific solution I wanted. I can even change the look'n'feel for every client if asked.
I hope this could help someone a day...
Regards.