473,671 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Display the Save as dialog before ...

Hello there all, am very new to asp.net programming and am struggling
with this problem.

What I trying to achieve.
On a button click I want the standard web save as dialog to display.
The user specifies where to save.
I then generate the file which is a series of reports zipped up, which
then gets saved to the users pc.

The following is some sample code:
responseObject. ClearContent()
responseObject. ClearHeaders()
responseObject. ContentType = contentType

responseObject. AddHeader("cont ent-disposition", "attachment ;
filename=""" & mZipFileName & """")

responseObject. BinaryWrite(mys trm.ToArray)
responseObject. Flush()

BuildZipStream( mystrm) ' Routine for performing the reports and
zipping them up
responseObject. BinaryWrite(mys trm.ToArray)

The problem with this code the save as dialog always opens after I
have finished building up my zip file.
Is it possible to get the Save As dialog to display before I have a
file available and then start streaming the file. I am trying to avoid
instances where the web pages sits there waiting for the save dialog
to be displayed while the zip file is created.
Any help or suggestions would be appreciated.
Nov 18 '05 #1
1 1442
no. its you content type on the save that triggers the dialog box. you can
flush eariler.

-- bruce (sqlwork.com)
"M Pearson" <ma**********@t echop.co.uk> wrote in message
news:99******** *************** ***@posting.goo gle.com...
| Hello there all, am very new to asp.net programming and am struggling
| with this problem.
|
| What I trying to achieve.
| On a button click I want the standard web save as dialog to display.
| The user specifies where to save.
| I then generate the file which is a series of reports zipped up, which
| then gets saved to the users pc.
|
| The following is some sample code:
| responseObject. ClearContent()
| responseObject. ClearHeaders()
| responseObject. ContentType = contentType
|
| responseObject. AddHeader("cont ent-disposition", "attachment ;
| filename=""" & mZipFileName & """")
|
| responseObject. BinaryWrite(mys trm.ToArray)
| responseObject. Flush()
|
| BuildZipStream( mystrm) ' Routine for performing the reports and
| zipping them up
| responseObject. BinaryWrite(mys trm.ToArray)
|
| The problem with this code the save as dialog always opens after I
| have finished building up my zip file.
|
|
| Is it possible to get the Save As dialog to display before I have a
| file available and then start streaming the file. I am trying to avoid
| instances where the web pages sits there waiting for the save dialog
| to be displayed while the zip file is created.
| Any help or suggestions would be appreciated.
Nov 18 '05 #2

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

Similar topics

3
13471
by: Kannan | last post by:
Hello, I have a requirement that specifies that I display a "Please Wait..." window (preferably modal) along with a gif that mimics a progress bar during a save operation. The dialog needs to be closed at the end of the operation. How do I go about this... Issues are: 1. I believe a showModaldialog would stop all back ground processing and shift control to the modal dialog. 2. I would like to close the dialog from the parent window...
2
2361
by: Alvo von Cossel I | last post by:
hi, i have a textbox in a form. when you press a Save button, a savefiledialog appears. creating ther file works but everytime you click save, the dialog appears. how do i make the dialog appear once and then only save the file? thanx -- Alvo von Cossel I of Germany
4
5097
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" Hyperlink1.NavigateUrl = "MyReport.csv" When the user clicks the HyperLink I would always like to
1
1875
by: Chan | last post by:
Hi I want to display save dialog box and display that file name in a text box All I want to do is, On click of a button, display save dialog box and display that file name in a text box Later this file name would be used to store some data response.addheader approach does not work in this situation because my requirement is quiet different Thank Chan
0
2967
by: Dune | last post by:
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. ...
3
6431
by: =?Utf-8?B?YXNkZg==?= | last post by:
Hello. I am making a web application with c# and am using this code: Response.ContentType = "application/x-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("あいうえお") + ".csv"); Encoding encoding = Encoding.GetEncoding("Shift-JIS"); Response.BinaryWrite(encoding.GetBytes(csvStr)); Response.End(); It works fine..the data gets saved nicely to an excel file. The user pushes the...
2
10981
by: vbaDev | last post by:
Hi. I am using Access 2000 and in my code I'm exporting a table into an Excel file (creating it), then the code needs to export another query into the same file (a new worksheet). So I needed both a "Save As" dialog and the ability to grab the filepath so that the second export appends to it. Anyway, I found Microsofts method and it works, except that I can't figure out how to populate the File Name box in the Dialog with a default name (say,...
8
21851
by: paquer | last post by:
I'd like to provide an Export Function from my forms, where the User can choose the File name & save location Although I cannot get the "Save As" dialog box to open properly from access. What is the proper code to get Access to open the Windows Save As dialog box? Thanks
0
3738
by: ppardi | last post by:
I'm developing an addin for Word 2007 and I need to determine whether a user saves a Word 2007 document in an older format (97-2003) after a save as is done. The scenario is that the user starts out with a Word 2007 document, saves that document to disk, then saves the same document in an older format If the user saves a doc in an older format, I want to turn off certain features of my add-in. I'm able to trap the save event easily...
0
8483
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8926
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
8824
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...
1
6236
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5703
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2818
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 we have to send another system
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.