Hello,
once the upload is completed, how can i call a javascript function (parameters will be the file name, size etc..) instead of posting the values to a php/cgi script ?
I'm using the latest pro version.
Thank you for your help
Kind Regards,
Cyril
XUpload - [Solved] Use javascript fct instead of url_post
[Solved] Use javascript fct instead of url_post
Last edited by cyriltra on Jul 26, 2008 7:13 am, edited 1 time in total.
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
In upload.cgi find thi part of code
and replace it with
where my_func is your function defined on upload page.
Code: Select all
print"<HTML><BODY><Form name='F1' action='$url_post' target='_parent' method='POST'>";
for my $f (@files)
{
print"<textarea name='$_\[]'>$f->{$_}</textarea>" for @file_fields;
}
print"<textarea name='$_->{name}'>$_->{value}</textarea>" for @har;
print"</Form><Script>document.location='javascript:false';document.F1.submit();</Script></BODY></HTML>";
Code: Select all
print"<HTML><BODY><Script>";
for my $f (@files)
{
print"window.parent.my_func('$f->{file_name}','$f->{file_name_orig}','$f->{file_size2}','$f->{file_size}','$f->{file_status}');";
}
print"</Script></BODY></HTML>";
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
Try to add this before
this will reload progress bar iframes and stop ajax requests.
Code: Select all
print"</Script></BODY></HTML>";
Code: Select all
window.parent.frames['transfer'].location='blank.html';
window.parent.frames['transfer2'].location='blank.html';