Hello. Long time Moodle admin, first time poster.
Moodle environment: 2.4.6+ (newest build as of 9/27/13)
PHP: 5.3.2 (Can not upgrade to 5.3.3 due to server limitations)
Server: Dedicated host on an Ubuntu box
File permissions: moodle_data set to 777 (temporarily)
We had a Moodle site that was at 1.9 for a long time. Due to some security issues (that have been resolved), we finally upgraded from 1.9 to 2.2 to 2.4 in July 2013. The upgrade process went smoothly, with all of our courses and course files, including images and PDF links, carrying over fine for each of the 60+ courses. The client made the decision to keep the site inactive for the public since June 2013 and had a target goal of updating course content for a relaunch in October 2013.
In mid-September, the client continued updating course but a funny thing happened - the previous Legacy Course File images and files stopped appearing in the browser. The images simply stopped showing up, appearing as red X as a broken image. When I would try to use the file browser (server files) to see the images, the thumbnail previews did not appear. Going to the file directly (based on the html path from Moodle) did not render the file either and instead showed it as what I can only assume is ASCII. This seems to be the case for all images on the site, not including ones that come with a theme such as icons and such (the thumbnails on the theme selector page are broken as well). I have included images for both of these scenarios so you can see the issue.
This issue seems similar to what was reported here - https://moodle.org/mod/forum/discuss.php?d=218764 - but that thread never had a solution to the issue posted due to some other issues not related for that user.
I have restored the site from a previous backup before the client started editing, both the files and the database, to no effect. I have had the host check permissions, make sure everything was in binary mode (files were never uploaded via ftp, all were added via Moodle's interface in the previous 1.9 version) and that was not the solution. If I download one of the legacy course files locally, specifically an image, I can not get a preview of it (In Preview on OS X) BUT I can open the file itself in Photoshop.
Adding a new file, with a new file name presents the same issue of not rendering correctly, even if Moodle has never seen the file before. All files are going to the general Server files bucket.
The path to the moodle_data folder is correct, the HTML output for the image itself is correct (not broken tags like referenced in the post I linked to). I think that the issue is related to the file.php and its associated libraries but I am not a PHP programmer so I am not sure.
I have cleared theme caches more times than I can count, updated to the newest possible version and still the images simply won't render. So essentially the issue seems to be something has happened to the moodle_data folder (which is stored outside of the site, as recommended by Moodle) and due to the way Legacy Course Files are saved there is no specific way for me to figure out if an errant file is causing it or anything.
I am officially stumped, the host is stumped and the client is really hoping we don't have to offload their images to a separate site and redo all of the uploads.
I will be happy to answer any questions or provide any more information if needed. Any and all suggestions are appreciated and thank you in advance!