ColdFusion 8: Data corruption when writing out binary data.
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.