Getting error when trying to display PDF file in classic ASP

I have an .asp page that has been working fine for months displaying PDF files. I just brought in a collection of 8,000 new PDF documents and now I get a "The file is damage and could not be repaired." when trying to view these new PDF documents in Internet Explorer. The PDFs view fine in Google Chrome. This is a public-facing website so I don't have control over what browser the user is using. Here is the code:


Set oFileStream = Server.CreateObject("ADODB.Stream")

oFileStream.Open

oFileStream.Type = 1 'Binary

oFileStream.LoadFromFile "c:\ldpdfs\AHCD.pdf"


Response.ContentType = "application/pdf"

Response.AddHeader "Content-Disposition", "inline; filename=" + PDFpath

Response.BinaryWrite(oFileStream.Read)


oFileStream.Close

Set oFileStream= Nothing


Please help.


Thanks,
 
Hmm; Disable the
Code:
"Content-Disposition", "inline; filename="
in your ASP and ensure you deliver as
Code:
 "Content-Transfer-Encoding: base64"
 
General Repair of Adobe Acrobat Reader

- Go to adobe website, click the "Support" tab on the top of the screen, and click on "Adobe Reader," and then select the "I can't open a PDF document" statement underneath "Troubleshooting." The Support tab is located near the top of the screen as a white word against a black backdrop. After clicking Support, you will see the phrase "Product Support Centers" on a new page in bold white font, under which is "Adobe Reader." The new page after clicking "Adobe Reader" will have the word "Troubleshooting" underneath the phrase "Adobe Reader and Help Support." Underneath "Troubleshooting" is "I can't open a PDF document."

- Follow the instructions on how to complete a general repair and installation of Adobe Acrobat Reader. To attempt the most basic PDF repair method, Open "Adobe Acrobat Reader" (select the program in your Start menu, which is on the bottom-left part of the screen), select "Help" from the gray tab menu at the top of Adobe Acrobat Reader, and click on "Repair Adobe Reader Installation." A meter should pop up indicating that your Adobe version is being checked for errors and is being linked back to the home Adobe website just in case you need to download a new update of the program. If you need to download an updated version of the program, another pop-up will appear on your screen asking you if you want to update Adobe. Click "Yes."

- Reopen the PDF file. It should now be readable. If not, then try the next set of directions.

- As last tip visit https://forums.adobe.com/message/6978758
 
Back