Error message "the file is damaged and could not be repaired"

Posted on 2014-07-14
Last Modified: 2014-07-16

I need your help please.

In my coldfusion code, I have my project to upload any type of documents but for some reason .pdf and .msg gives me an error that says "There was an error opening this document. The file is damaged and could not be repaired"

I am not sure why the project open up .doc or any other files fine but the .pdf and .msg

Question by:lulu50
    LVL 39

    Accepted Solution

    Are you saving these files into the database?   If so, perhaps the pdf and msg files are larger than the .doc files and they are getting cut-off.   There is a setting in the /CFIDE/administrator to only fetch a limited string size, perhaps you are exceeding it with these file types.  

    The setting is under "Advanced Settings" for your data source definition and is called LONG TEXT BUFFER or BLOG BUFFER

    Author Comment


    Yes, I am saving the files to the database.

    the file size of the .pdf is the same as the .doc file

    what is the data source definition?

    FileID      int      Unchecked
    IssueID      int      Checked
    FileName      varchar(255)      Checked
    Description      varchar(255)      Checked
    UploadedFile      varchar(MAX)      Checked
    Status      int      Checked
    uploadedasbinary      varbinary(MAX)      Checked
    CreatedDate      datetime      Checked
    LVL 39

    Expert Comment

    The data source definition is the place in the CFIDE/Administrator where you define the datasource which points to your database.   Click on the datasource and then the advanced options to see this field.   The setting limits the amount of data that will be fetched from the database.    I ran into this problem when opening large data, it literally truncates the data fetched, sounds like that is what is happening to you.

    Author Comment


    Thank you for your help.  That was the problem!!!!!

    Author Closing Comment

    Thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
    Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now