I am invoking a file download using the following code:
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
downloadFile.Name);
Response.AddHeader("Content-Length", downloadFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(downloadFile.FullName);
Response.End();
This works with one issue. The user is provided with the "File
Download" dialog box that provides them with the options (Open, Save,
Cancel, More Info) twice, forcing the user to click on "Open" twice.
There is one difference, the first time that the "File Download"
appears the check box "Always ask before opening this type of file" is
disabled and has a check in it. The second time it is enabled and the
status version is displayed behind the prompt. Clicking "Open" the
second time opens the file.
What would cause this behaviour - we have another application developed
in VB Visual Studio 2003 and the "File Download" works as expected
(first time).
Second thing where can one find documentation that describes the
available options for the "Response" (AddHeader, ContentType). The
documentation that I have found leaves much to be desired.
TIA
Scott M.