Redirect after file upload.

M

Manuel

I have a page that uploads a file to the user. Since the file is created on
the fly and it takes a few seconds to generate, I present a "Please Wait"
screen until the file is uploaded. This is the code on the wait page:

--------------
<script language="javascript">

var iLoopCounter = 1;
var iMaxLoop = 5;
var iIntervalId;

function BeginPageLoad() {
location.href = "<%= Request.QueryString("Page") %>";
iIntervalId =
window.setInterval("iLoopCounter=UpdateProgress(iLoopCounter, iMaxLoop)",
500);
}

function EndPageLoad() {
window.clearInterval(iIntervalId);
Progress.innerText = "Page Loaded -- Not Transferring";
}

function UpdateProgress(iCurrentLoopCounter, iMaximumLoops) {

iCurrentLoopCounter += 1;

if (iCurrentLoopCounter <= iMaximumLoops) {
Progress.innerText += ".";
return iCurrentLoopCounter;
}
else {
Progress.innerText = "";
return 1;
}
}
</script>
</HEAD>
<body onload="BeginPageLoad()" onunload="EndPageLoad()"
background="Pictures/back.gif">
--------------


Request.QueryString("Page") is the page that uploads the file to the user

I need the user to go back to the first page (the one before the wait
screen) via a browser back. Anyone have an idea how to do it or a better way
to display a wait screen and then upload a file? I tried putting
"history.go(-2)" here, there and everywhere but haven't found a way.

This is the code I use to upload the file:
--------------
Response.ContentType = "application/octet-stream"
Response.ContentType = "application/zip"
Response.AppendHeader("Content-Disposition", "attachment; filename="
& UserFileName)
Response.AddHeader("Content-Length", fi.Length.ToString())
Response.WriteFile(fi.FullName)
Response.Flush()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top