XUpload - Using XUpload twice in same website

Message
Author
tubbly
Posts: 18
Joined: Sep 06, 2006 10:59 pm

Using XUpload twice in same website

#1 Postby tubbly » Sep 20, 2006 12:43 pm

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) ?

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

#2 Postby PilgrimX182 » Sep 21, 2006 6:23 am

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:

Code: Select all

$redirect_link=$cg->param('redirect') if $cg->param('redirect');


upload_form.html: after form tag add this string:

Code: Select all

<input type="hidden" name="redirect" value="http://YOURURL">


if there won't be hidden input in html, script will use default from config.

This code will be in next XUpload release, thanks.

tubbly
Posts: 18
Joined: Sep 06, 2006 10:59 pm

#3 Postby tubbly » Sep 21, 2006 8:30 am

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.

admin
Site Admin
Posts: 1805
Joined: Mar 22, 2006 12:32 pm

#4 Postby admin » Sep 21, 2006 10:42 am

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.


Yes, if you will need latest version of XUpload - we will send it.

andrew
Posts: 13
Joined: Sep 23, 2006 10:26 pm

#5 Postby andrew » Sep 23, 2006 10:31 pm

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

PilgrimX182 wrote:We have custom POST URL option

Butch
Posts: 29
Joined: Sep 14, 2006 1:44 am

#6 Postby Butch » Sep 24, 2006 2:08 pm

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.

andrew
Posts: 13
Joined: Sep 23, 2006 10:26 pm

#7 Postby andrew » Sep 24, 2006 3:59 pm

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


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.

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

#8 Postby PilgrimX182 » Sep 25, 2006 8:26 am

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

Code: Select all

my $url_post=$c->{url_post};


with this one:

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.


Return to “XUpload”



Who is online

Users browsing this forum: No registered users and 0 guests