473,440 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

Redirect after file upload.

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(iL oopCounter, 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()
--------------

After I flush the file I cannot send anything to the client.

How can I make the browser go back after uploading a file?
Nov 19 '05 #1
0 1374

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Damo | last post by:
Could someone please help me. I am a newbie at PHP. I downloaded formail.php Version 5.0 from Jacks scripts( http://www.dtheatre.com/scripts/ )and changed the required areas to my email address and...
1
by: FLUX (a l'Ircam) | last post by:
Hi Perl folk! I have the following problem : I want to upload a file (stored in a web server) to the browser, and then delete the file in the server. This file contains the results of a sound...
4
by: Andy | last post by:
Hi all, I'm having a problem with a response.redirect and firefox. I have an error hanlder setup in the global.asax which issues a response.redirect to a generic error page. This works fine...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
4
by: Dot net work | last post by:
I have noticed that this: Response.Redirect("/MyLocalDirectory/MyPage.aspx") seems to be a lot quicker than this: Response.Redirect(sDirectoryString & "MyPage.aspx") In local...
1
by: Shark Bait | last post by:
The code below is in my global.asax. When a user uploads a file that is to big it catches the error and tells the user the problem. For some reason the redirect never happens. When steping through...
1
by: Johannes Klos | last post by:
Hello I am new to ASP.NET Development, but I have a serious problem. I want to Redirect to something like \\server\share\file But it does not work. The only way I can make the client show the...
5
by: Lupus | last post by:
Hi there! I have some strange behavior in a ASP VB.NET application. I've used response.redirect many times in different pages, and it works like a charm. However in a new page I'm making, the...
0
by: ll | last post by:
I'm working with 'pure ASP upload' script which is designed to redirect to an alert/error message, should a file larger than the set limit be attempted to be uploaded. The problem is that, while...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.