473,489 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Open/Save dialog

Hi there,

I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they entered. When this button is pressed and extract is prduced and IE's standard Open/Save dialog should popup so they can navigate to the directory to save the extract in, or if they want, they can choose to open and view the extract without saving it.

To make the Open/Save dialog popup, my code-behind uses the Response object and appends headers and sets the content type. So far so good. When the extract is a text file named using the .txt file extension, everything works as expected. However, when the extract is a comma separated file named using the .csv extension, the Open/Save dialog pops up TWICE when the Open button is pressed in the dialog.

This seems to be related to this known bug in IE:
Microsoft Knowledge Base Article - 238588 - Internet Explorer Prompts the User with Two Open or Save Dialog Boxes

http://support.microsoft.com/default...b;EN-US;238588

Does anyone know a work around? And why does this problem only occur with .csv files and not with .txt files?

Here is what my code-behind is doing:

' Turn on buffering if needed
If Not Response.BufferOutput Then
Response.BufferOutput = True
End If

' Clear the current output content from the buffer
Response.Clear()

' Add the header that forces the Download/SaveAs dialog to be displayed and
' specifies the default filename for the dialog
Response.AppendHeader("Content-Disposition", "attachment; filename=" & sFileName)

' Add the header that specifies the file size, so that the browser
' can show the download progress
Response.AppendHeader("Content-Length", sDataToSave.Length.ToString())

' Specify that the response is a stream that cannot be read by the client
' and must be downloaded
Response.ContentType = "application/octet-stream"

' Send the file stream to the client
Response.Write(sDataToSave)

' Send data in buffer and stop the execution of this page to ensure we only send
' the data we want and not other parts of this page
Response.End()
Nov 18 '05 #1
0 2951

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

Similar topics

1
12537
by: Venkat | last post by:
Hi, I have an file1.exe file stored at some physical location say C:\Test\file1.exe. I created a virtual folder say MyFolder pointing to my physical folder(C:\Test\). I wrote this piece of...
3
1958
by: Newbie | last post by:
I am trying to get the save/open dialog figured out. I am able open the save dialog but when I put in a file name (whatever.txt) and save the file does save with the name but it is blank. Below...
2
2625
by: Pat Richey | last post by:
i'm trying to make an open and a save file dialog that allows you to open/save various formats, but when you change the extension you want to filter the file list disappears until you leave the...
4
5070
by: John | last post by:
Hi, I generate a report in a comma delimited file and give it a name like MyReport.csv . I then set a Hyperlink control to point tp the file HyperLink1.text = "Download"...
2
3181
by: Jonathan Trevor | last post by:
Hi, For the last couple of releases of a product we're developing we've been running to very wierd behavior from IE and our ASP.NET web application which serves up various types of files and I'm...
4
3654
by: Dorte | last post by:
Hi, I am using the code below to stream a CSV file with the response object. Dim FileName As String = "Test.csv" With Web.HttpContext.Current.Response ...
6
2685
by: Michael Groeger | last post by:
Hi, I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save...
4
2899
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes...
2
2486
by: BusyBoy | last post by:
Hi All I am using two aspx pages The first aspx page loads the second page in a popup window. The second aspx page has no html and I change its content type to download a particular file. ...
0
6967
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
7142
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
7181
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
5445
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
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
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...

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.