Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - VB Script

Reply
 
Old 07-31-2008   #1 (permalink)
dangoble


 
 

VB Script

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 System SpecsSystem Spec
Old 07-31-2008   #2 (permalink)
Old Pedant


 
 

RE: VB Script

"dangoble@xxxxxx" wrote:
Quote:

> 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 System SpecsSystem Spec
Old 07-31-2008   #3 (permalink)
Evertjan.


 
 

Re: VB Script

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

> 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 System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Logon Script Causing Laptops To Hang - Problems in script? VB Script
problem passing args to script 'There is no script engine for file extenstion' VB Script
Include another script, keep variables in included script? PowerShell
Script file has 'OS Handle' error when run from script PowerShell
Can you drag-n-drop a file on top of a PS script to run the script? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46