473,324 Members | 2,178 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,324 software developers and data experts.

Redirect after writing a file to the response?

Is there a way to achieve to following:
1) ASP page is loaded to client.
2) User submits form, requesting a file download
3) File is generated and written to response
4) User receives file, saves it and closes the dialogs.
5) ASP page redirects to another URL

I've tried many ways to accomplish this, both client and server side.
Client-side looks possible but with some complicated coding.
Server-side appears easier to manage, but my knowledge of ASP is limited - it looks impossible as the user cannot fully download the file until the repsonse ends, therefore the redirect cannot be transmitted; similarly sending the redirect first causes the file transmission to screw up client-side and the user is not prompted to save it.

Any ideas? I'm hoping that I'm missing something.
Oct 30 '07 #1
2 1532
jhardman
3,406 Expert 2GB
... I'm hoping that I'm missing something.
NO, that sounds about right. File downloads tend to be frustrating in that regard. I would try opening the file using a different window, and use client-side scripting to redirect.

Jared
Oct 31 '07 #2
JamieHowarth0
533 Expert 512MB
Hi Andy,

Jared has made a very good suggestion, lots of sites use the Javascript mini-window technique (such as download.com), however, you have to advise your users to accept popups otherwise the download window won't open and your user will just be sat there without their file and wondering why!

The other technique you could try is as follows:

1) ASP page loaded to client
2) User submits form, requesting file
3) Upon form submission, user is passed to final "step 5" page containing <iframe>
4) Iframe points to ASP file that generates user-requested file and writes to response (which will then ping up the "Download File" dialog).

This is the technique that Microsoft and SourceForge use, and avoids the popup window issue.

Hope it helps!

Best regards,

medicineworker
Oct 31 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steve Lutz | last post by:
Hello, I have a page that creates a class, and then on certain conditions, redirects user to another page. The class has a Class_Terminate() function that saves itself to a database. The class...
3
by: shank | last post by:
I have the following code to redirect users to http://www.mydomain.com/new/default.asp if they use the URL www.newstuff.com (sample). I have that domain name parked on www.mydomain.com. I'm getting...
3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
6
by: Peter Row | last post by:
Hi, I am writing a DLL in VB.NET that implements IHttpHandler.ProcessRequest. This code calls a sub and I need to know if that sub did a response redirect or not. Specifically I need to know...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
8
by: Andreas Klemt | last post by:
Hello, I get this error Message "cannot redirect after http headers have been sent" when I do this response.redirect ("home.aspx") How can I find out with vb.net if already a http header has...
10
by: Urs Eichmann | last post by:
If I have two webforms, form1.aspx and form2.aspx, and I want to do a Response.Redirect from form1 to form2, I can write Response.Redirect("form2.aspx") However, if somebody changes the name...
1
by: Andrew Poulos | last post by:
I have a simple page with a form in it that gets posted to the following ASP <%@ language="javascript" %> <% var login_success_page = "../intro.asp"; var login_failed_page =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.