473,769 Members | 4,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="javas cript">

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

function BeginPageLoad() {
location.href = "<%= Request.QuerySt ring("Page") %>";
iIntervalId =
window.setInter val("iLoopCount er=UpdateProgre ss(iLoopCounter , iMaxLoop)",
500);
}

function EndPageLoad() {
window.clearInt erval(iInterval Id);
Progress.innerT ext = "Page Loaded -- Not Transferring";
}

function UpdateProgress( iCurrentLoopCou nter, iMaximumLoops) {

iCurrentLoopCou nter += 1;

if (iCurrentLoopCo unter <= iMaximumLoops) {
Progress.innerT ext += ".";
return iCurrentLoopCou nter;
}
else {
Progress.innerT ext = "";
return 1;
}
}
</script>
</HEAD>
<body onload="BeginPa geLoad()" onunload="EndPa geLoad()"
background="Pic tures/back.gif">
--------------
Request.QuerySt ring("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.Conten tType = "applicatio n/octet-stream"
Response.Conten tType = "applicatio n/zip"
Response.Append Header("Content-Disposition", "attachment ; filename="
& UserFileName)
Response.AddHea der("Content-Length", fi.Length.ToStr ing())
Response.WriteF ile(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 1393

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

Similar topics

1
8026
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 the domain server address. (these changes were in the $recipient and $referers section) I have set up the form and can get the form to email me the results. I have two main problems. The first one is that I am trying to get the form to go to a...
1
7467
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 analysis/synthesis and is named XXX.zip with XXX the basename of the initial sound file... If I used: "redirect(-uri=>$UPLOAD_DIR/my_file.zip);" it would be OK, but then I can't delete the file after it is
4
4041
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 in IE, but in firefox I get an alert 'The document contains no data.' The error occurs when the user attempts to submit a form with file uploads larger than the server expects. I click the asp:button to submit, but the browser doesn't like the...
13
4321
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 that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
4
3716
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 development mode, I need to have sDirectoryString equal to my
1
1099
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 the code it does step into the redirect but continues to the next line like nothing happened and it does NOT redirect! Any ideas why this would happen? The code... (thanks Mike Gunderloy)... protected void Application_Error(Object sender,...
1
2405
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 file ist to use Response.WriteFile or Response.Write But then the user cannot change anything in the file and save it back to \\server\share\file He has to manually store it there again. Is there a way to solve that problem?
5
2272
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 browsers behavior is different than in my previous pages. Internet explorer just gives a blank screen. Firefox shows a text "The page has moved to here"...
0
2674
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 smaller files do upload successfully, the script does not catch the larger files and rather than a specific error message in Firefox (and IE7), I just get the following: ------------------------------------ The connection was reset The...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.