• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

VB Script

D

dangoble

#1
Hi,
I am using an uploader program (.asp) that is written VBscript

<%
Response.Expires = -10000
Server.ScriptTimeOut = 300

Set theForm = Server.CreateObject("ABCUpload4.XForm")
theForm.Overwrite = True
theForm.MaxUploadSize = 8000000
theForm.ID = Request.QueryString("ID")
Set theField = theForm.Files("filefield1")
If theField.FileExists Then
theField.Save "Holdhomes/" & theField.FileName
End If
%>

<html>
<body>
Upload Complete...
<%
response.redirect("http://www.xxx.com/")
%>
</body>
</html>


As you can see the "Upload Complete..." never shows because the
program immediately redirects back to the upload page to allow my user
to upload another pic.
Please show me how to place a pause of 5 seconds in there so the user
can see the upload is complete and be returned back to xxx.com in 5
seconds
Thanks
 

My Computer

O

Old Pedant

#2
"dangoble@xxxxxx" wrote:

> As you can see the "Upload Complete..." never shows because the
> program immediately redirects back to the upload page to allow my user
> to upload another pic.
> Please show me how to place a pause of 5 seconds in there so the user
> can see the upload is complete and be returned back to xxx.com in 5
> seconds
You *CAN'T* do it in server side code. Period.

You must do it in the browser.

So...
<head>
<script language="javascript">
function goBack( )
{
location.href = "uploadPage.asp"; // or wherever
}
</script>
</head>
<body onLoad="setTimeout( 'goBack( )', 5000 );">
Upload complete...
<p> <p>
<a href="uploadPage.asp">Click here</a> if page doesn't refresh in 5 seconds.
</body>

***********

You could instead use a META-REFRESH, to avoid JavaScript, if you needed.
 

My Computer

E

Evertjan.

#3
wrote on 31 jul 2008 in microsoft.public.scripting.vbscript:

> Hi,
> I am using an uploader program (.asp) that is written VBscript
>
> <%
> Response.Expires = -10000
> Server.ScriptTimeOut = 300
>
> Set theForm = Server.CreateObject("ABCUpload4.XForm")
> theForm.Overwrite = True
> theForm.MaxUploadSize = 8000000
> theForm.ID = Request.QueryString("ID")
> Set theField = theForm.Files("filefield1")
> If theField.FileExists Then
> theField.Save "Holdhomes/" & theField.FileName
> End If
> %>
>
> <html>
> <body>
> Upload Complete...
> <%
> response.redirect("http://www.xxx.com/")
> %>
> </body>
> </html>
>
>
> As you can see the "Upload Complete..." never shows because the
> program immediately redirects back to the upload page to allow my user
> to upload another pic.
> Please show me how to place a pause of 5 seconds in there so the user
> can see the upload is complete and be returned back to xxx.com in 5
> seconds
The response.redirect sets a redirect in the html header, so that nobody
is ever seen by the client.

Use a clientside redirect, with a <meta> or javascript timer.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 

My Computer

Users Who Are Viewing This Thread (Users: 1, Guests: 0)