hankknight
asked on
ASP.NET/VB: Reading file causes it to become corrupt
This causes good PDF documents to become corrupt. I cannot view them after downloading them from this:
Dim pdfFileNew As System.IO.FileInfo
pdfFileNew = My.Computer.FileSystem.GetFileInfo(resultFile)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment; filename=brochure.pdf")
Response.AddHeader("Content-Length", pdfFileNew.Length.ToString().Length)
Response.ContentType = "application/octet-stream"
Response.WriteFile(resultFile)
Response.End
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
before the .End() but that may be a remnant from the past and not really needed any more.