I want to display a PDF file and it working but when i'm clicking the saveing button it ask me to save a aspx page and not PDF file? this is my code:
string path = CanvasWritingStepImages._pdfName;
WebClient client = new WebClient();
Byte[] buffer = client.DownloadData(path);
if (buffer != null)
{
//content-disposition
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", "attachment ;filename=Formulike.PDF");
Response.BinaryWrite(buffer);
}
else
{
logger.Error("Buffer was Null!");
}
how i can make it a PDF file when i'm saving it? may be to open in new tab? if so, how can i do it?