I'm going to be using XUpload on 2 different parts of our website for 2 different purposes.
At the moment, XUploadConfig.pm redirects to a particular url.
How can I use XUpload again, because the redirect_link urls will be different (as will a few other options in the config file) ?
XUpload - Using XUpload twice in same website
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
We have custom POST URL option, but no such thing for Redirect yet, so here's small code addition for ya:
upload.cgi: after my $redirect_link = $c->{redirect_link}||$ref; put this:
upload_form.html: after form tag add this string:
if there won't be hidden input in html, script will use default from config.
This code will be in next XUpload release, thanks.
upload.cgi: after my $redirect_link = $c->{redirect_link}||$ref; put this:
Code: Select all
$redirect_link=$cg->param('redirect') if $cg->param('redirect');
Code: Select all
<input type="hidden" name="redirect" value="http://YOURURL">
This code will be in next XUpload release, thanks.
Yes, if you will need latest version of XUpload - we will send it.tubbly wrote:Thanks for the sneak preview of the next release!
I'll try it as soon as I get the chance.
BTW, are people who purchased Pro2.2 entitled to upgrades when they're released?
Your prompt responses to this forum is appreciated too.
I too am trying to use multiple itterations of XUpload Pro on the same site. I'm trying to avoid having to create a seperate CGI sub directory for each, Can you explain how the custom POST URL works. What I want to do is pick the URL to post to based on the upload form rather than the configuration file.
I have the version of XuploadPro dated 24 May 2006.
Thanks for your help.
Andrew
I have the version of XuploadPro dated 24 May 2006.
Thanks for your help.
Andrew
PilgrimX182 wrote:We have custom POST URL option
In normal operation you just configure "url_post" in XUploadConfig.pm to the url of the page that handles the post and the cgi will post all of the variables from your upload form to that page when the upload completes.
Hope this helps.
Andrew
Hope this helps.
Andrew
Butch wrote:For some reason I cannot get Xupload pro to redirect to my html page. I'm sure it is because I don't understand how to configure post so the string is empty and will redirect to your html page.
Everyone else has this feature working. Does someone have the dummy steps for me.
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Oh, I'm sorry Andrew, we had this feature in older version, but I've disabled it due to security issues.
Some hacker can use his own POST URL to his script and receive POST variables containing target_dir path on your server. I guess it's not so bad vulnerability, but removed it to be safe.
Anyway, if you wanna use it here's the quick fix for this:
in upload.cgi replace this string
with this one:
this will use POST URL from 'url_post' hidden input (add hidden input to your form <input type="hiden" name="url_post" value="http://mysite/post2.php">), if no such hidden input in form, script will use default URL from config.
In next versions I probably will implement array of custom POST/Redirect URLs and will send only number to be safe.
Some hacker can use his own POST URL to his script and receive POST variables containing target_dir path on your server. I guess it's not so bad vulnerability, but removed it to be safe.
Anyway, if you wanna use it here's the quick fix for this:
in upload.cgi replace this string
Code: Select all
my $url_post=$c->{url_post};
Code: Select all
my $url_post = $cg->param('url_post') || $c->{url_post};
this will use POST URL from 'url_post' hidden input (add hidden input to your form <input type="hiden" name="url_post" value="http://mysite/post2.php">), if no such hidden input in form, script will use default URL from config.
In next versions I probably will implement array of custom POST/Redirect URLs and will send only number to be safe.