|
|
 |
FN-FORUM: Forcing a file download dialog box
date posted 21st January 2005 17:40
In .NET I need to force a file download dialog box to save a file stored in
a SQL Server database. I am using the following code:
Response.AddHeader("content-disposition","attachment; filename=" +
fileName);
Response.ContentType= mimeType;
Response.BinaryWrite(fileContents);
This forces the file download dialog box to appear and is then saved with
the correct filename and not that of the aspx script outputing the data.
However, I still have one problem, I am using some javascript code to create
the popup window which forces the file download dialog box but when I have
finished saving the file the pop up window still remains but I need it to
close - has anybody got any ideas about this?
Best Regards
John
|
 |
|