4
Answers

not able to download a pdf file in ie11(asp.net application)

Yogesh Jadhav

Yogesh Jadhav

10y
3.4k
1
i have one application where i am giving a link to user to download files and that is working fine in chrome but its not working in IE11 and this problem is with only few files(which has size more than 1MB). files i am getting threw database.
can anyone help me on this?
below is the code sample:
 
 
Response.Clear();
Response.Buffer = true;
Response.ClearContent();
Response.ClearHeaders();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}", drAttchmentInfo["FileName"].ToString()));
Response.ContentType = "application/" + drAttchmentInfo["DocumentType"].ToString();
Response.BinaryWrite((byte[])drAttchmentInfo["Document"]);
//Response.End();
Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
Response.Close();
Answers (4)