I am using the following code below to download Pdf from a url, i would like to have some idea what would be the best practise, I am just concern with performance and file size thanks.
using( WebClient wc = new WebClient() )
{
byte[] data = wc.DownloadData("http://localhost:81/File/sample.pdf");
Response.Clear();
Response.ContentType = "application/pdf";
Response.AppendHeader( "Content-Disposition" , "attachment;filename=data.pdf" );
Response.BufferOutput = true;
Response.AddHeader("Content-Length", data.Length.ToString());
Response.BinaryWrite(data);
Response.End();
}