I have page with iframes that download and display files. File download seems not consistent though request to the page specificed in iframe works if given on a separate tab:
protected void Page_Load(object sender, EventArgs e)
{
Response.Buffer = false; //transmitfile self buffers
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "inline;filename=" + file.DocumentName);
Response.TransmitFile(path); //transmitfile keeps entire file from loading into memory
Response.End();
}
Go to the complete details ...