path="" need to mention here. System.Net.WebClient client = new System.Net.WebClient(); Byte[] buffer = client.DownloadData(path); if (buffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer); }
Response.AppendHeader("content-disposition", "inline; filename=sample.pdf");
Response.Redirect("www.sample.com/folder/test.pdf"); //In your case path
string path = Server.MapPath("PDFFileFolder") + @"\MyPDFFile.pdf"; System.Net.WebClient client = new System.Net.WebClient(); Byte[] buffer = client.DownloadData(path); if (buffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer); }
Response.Redirect("~/Yourfolder/file.pdf");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)