Rip's Domain

ColdFusion 8: Data corruption when writing out binary data.

Posted in ColdFusion by rip747 on March 31, 2009

Just a quick not to myself and others out there. Just today I had one of my users call me and complain that when they were trying to view a PDF from one of our applications Adobe Reader was complaining that the file was corrupt.

Now this application has been in production for 7 years and we never had a problem with it, why would all of a sudden would it start corrupting files? The application using the database to store the files (don’t ask, I didn’t write the original app) so in CF I have to write the file to disk using <cffile action=”write”> and then flush the file to the browser.

After a little detective work, it dawned on me. About 3 months ago, I finally updated the server to CF8 from CF7. The migration went really smooth and everything seemed to work fine. Something told me to get into CFAdmin and see if the blob support setting for the DSN was on. Well come to find out it wasn’t. After enabling it everything is working fine again.

So check any advanced settings that you might have had enabled on your DSNs if your did an upgrade and make sure that they are still enabled.


One Response

Subscribe to comments with RSS.

  1. Shital said, on April 12, 2010 at 4:34 pm

    Dude, you are the best. This helped solve a major issue. THANKS A TON!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: