Problem of asp.net content streaming PDF not functioning in some browsers
What are the possible omissions or problems on asp.net code not content streaming pdf on some browsers for some application I developed?
What are the possible omissions or problems on asp.net code not content streaming pdf on some browsers for some application I developed?
Hello Julia,
Hope you are doing well!
I have faced this a many times and mostly with IE, the below is what I had tried once.
Response.AddHeader("Content-Disposition", "attachment;filename=" + attachment.Name);
Hello Julia Daniele,
You must not worry at all about this issue. This is a very common problem with asp.net and different browsers. To get this problem fixed in IE, you have to include the file length in the header for pdf to work. Give a try with this code;
Response.Buffer = true;
Response.ContentType = “application.pdf”;
Response.AddHeader(“Content-Disposition”,”attachment;filename=” + FileName );
Response.OutputStream.Write(dataBytes,0,FileContentLength);
Hopefully, this will work.