I've got a web service that returns data in byte[] format and I want to display it or allow the user to download the file. Is there a page that I can inherit to allow this to happen simply by me passing the byte[] object to it? I've attempted to simply perform a response.binarywrite(byte[] object) with little success. I continue to receive an I/O error when the PDF opens.
I have my page located here: /CMSPages/SubFolder/GetReport.aspx
Code is simple:
Response.Clear();
Response.ContentType = "application/pdf";
Response.BinaryWrite(byteData);
Response.AddHeader("Content-Disposition", "inline; filename=statement.pdf");