I am writing an application in MVC4.
I have a physical pdf file on the server. I want to convert this to a memory stream and send it back to the user like this:
Worked it out
var pdfContent = new MemoryStream(System.IO.File.ReadAllBytes(imageLocation)); pdfContent.Position = 0; return new FileStreamResult(pdfContent, "application/pdf");