FileInfo infofile = new FileInfo(Filename); string myFile = Filename; WebClient myWeb = new WebClient(); Byte[] myBuff = myWeb.DownloadData(myFile); Response.Expires = 0; Response.CacheControl = "no-cache"; Response.AppendHeader("Pragma", "no-cache"); Response.Buffer = true; Response.ContentType = contenttype;//"application/pdf"; Response.AddHeader("Content-Disposition", "attachment; filename=" + infofile.Name); Response.BinaryWrite(myBuff);
suhailnoorpawane wrote:The Code which I am using to open the PDF along with any other type of file is as shown below
ContentType
Response.Flush(); Response.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)