Currently, this code works fine in a regular browser window:
if (readerObj.Read())
{
filename = readerObj["TRANATTACHMENTNAME"].ToString();
fileBytes = (byte[])readerObj["TRANATTACHMENT"];
Response.Clear();
Response.ContentType="application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.BinaryWrite(fileBytes);
Response.Flush();
Response.End();
dbConnectorObj.Connection.Close();
dbConnectorObj = null;
return true;
}
Unfortunately, this window needs to be modal (i'm modifying an already existing application). When I run the window modally, there's no file download dialogue.
ASP.NET 2.0
Any thoughts?