i had changed Server mappath to Resolveurl on string FilePath , it works but it takes too much time too load ,(approximatly 4min to load),why its happning,See below
//string FilePath = Server.MapPath("sa.pdf");
And changed code is:
- string FilePath = ResolveUrl("http://www.textbooksonline.tn.nic.in/Books/Std07/Std07-II-TamEng.pdf");
- WebClient User = new WebClient();
- Byte[] FileBuffer = User.DownloadData(FilePath);
- if (FileBuffer != null)
- {Response.ContentType = "application/pdf";
- Response.AddHeader("content-length", FileBuffer.Length.ToString());
- Response.BinaryWrite(FileBuffer);}
Thanks In Advance For Who Helps,