XUpload - JavaScript Error Alert to error page

Posts: 5
Joined: Sep 28, 2007 8:15 pm

JavaScript Error Alert to error page

#1 Postby happy » Oct 02, 2007 6:15 pm

Now that the max_upload_size alert works fine (see link, http://www.sibsoft.net/forum/exceed-upl ... -t419.html for more info), I have one little request. Because the alert message comes from upload_status.cgi is there a way to redirect the error to an error page instead of having an alert message?

I know how to do it if the alert is being created in upload.cgi, but I can't get it to work from upload_status.cgi.

If you are still confused I am talking about the DisplayMessage function in upload_status.cgi where you have the alert code,
$msg_pro = "alert('$MSG');"


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

#2 Postby PilgrimX182 » Oct 03, 2007 1:28 pm

Here's quick'n'dirty hack for you: try to add to error text in config JS code:

Code: Select all

<Script>setTimeout("parent.document.location='http://URL-TO-ERROR-PAGE';", 500);</Script>
this will redirect to error page after 0.5 sec after error message.
Haven't checked this yet, but should do the thing.

Posts: 5
Joined: Sep 28, 2007 8:15 pm

#3 Postby happy » Oct 03, 2007 1:54 pm

PilgrimX182 - you are the man.
Thanks for all the help and for the quick replies.