Hello,
I added an input named "code" in my upload form.
I searched everywhere but i don't understand how to do this :
1 - I have a random code in my php form (here : 521f26yu4j8k54g6hj)
2 - my form is submitted to the upload.cgi
3 - my code (variable) replace my filename
Example :
file uploaded = "archive-member-1346.zip"
final filename = "521f26yu4j8k54g6hj.zip"
Could you help me to do this ?
XUpload - How to use values from the upload form in the upload.cgi ?
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
in upload.cgi find:
and add line below:
Where code is name of your hidden field with random in html form (<input type='hidden' name='code' value='123456789'>)
Code: Select all
$fn = substr($fn,0,$c->{max_name_length});
Code: Select all
$fn = $cg->param('code');
Code: Select all
oh thank you very much!
just another question...
Can i add name and mail values from form too ?
Can i redirect to a page with these variables ?
print"<HTML><Script>parent.document.location='$redirect_link';</Script></HTML>";
like this :
print"<HTML><Script>parent.document.location='$redirect_link&code=$code&name=$name&mail=$mail';</Script></HTML>";
The syntax is not good...
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Actually POSTing all variables from html form to url_post.
This "parent.document.location=..." code is for situation when url_post is .htm(l) file. Try php file for url_post.
Also can try like this the line above:
This "parent.document.location=..." code is for situation when url_post is .htm(l) file. Try php file for url_post.
Also can try like this the line above:
Code: Select all
my $mail = $cg->param('mail');