Getting Error When Trying To Display Pdf File In Classic Asp

Discussion in 'General Software' started by wiktordymek, Jul 26, 2015.

  1. wiktordymek

    wiktordymek Geek Trainee

    Likes Received:
    0
    Trophy Points:
    1
    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,
     
  2. barnaclue

    barnaclue Geek Trainee

    Likes Received:
    0
    Trophy Points:
    0
    Make use of guide below if you can't get back .pdf file by instructions from Adobe or another method to see sources below Recovery Toolbox for PDF
     

Share This Page