M
M Pearson
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("content-disposition", "attachment;
filename=""" & mZipFileName & """")
responseObject.BinaryWrite(mystrm.ToArray)
responseObject.Flush()
BuildZipStream(mystrm) ' Routine for performing the reports and
zipping them up
responseObject.BinaryWrite(mystrm.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.
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("content-disposition", "attachment;
filename=""" & mZipFileName & """")
responseObject.BinaryWrite(mystrm.ToArray)
responseObject.Flush()
BuildZipStream(mystrm) ' Routine for performing the reports and
zipping them up
responseObject.BinaryWrite(mystrm.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.