Hi,
anytime when an error occurs while uploading (e.g. file size exceeded) the error message is shown by js (alert). instead of this i want to redirect the user to a specific error script (error.php) where the error message and some variables defined in the upload form (session, user name) should be shown. how can i solve this problem?
XUpload - Error popup
- PilgrimX182
- Posts: 2186
- Joined: Mar 22, 2006 1:39 pm
In upload.cgi replace line
with
where http://mysite.com/error.php is your error page and session_id & username are form fields on your upload_form.html
Code: Select all
print"<HTML><HEAD><Script>alert('$msg');</Script></HEAD><BODY><b>$msg</b></BODY></HTML>";
Code: Select all
my $cg = new CGI;
my $session_id = $cg->param('session_id');
my $username = $cg->param('username');
print"<HTML><HEAD><Script>document.location='http://mysite.com/error.php?session_id=$session_id&username=$username&msg=$msg';</Script></HEAD><BODY><b>$msg</b></BODY></HTML>";