Wordpress network not displaying images; images are corrupted

287 Views Asked by At

Using a Wordpress 3.x Network. After upgrading to the most recent version, all the images stopped displaying.

On further inspection, the image data is being transferred but the image files themselves are corrupted. Comparing an image sent by the Wordpress wp-includes/ms-files.php script with the source file on the server, it appears that extra white spaces is being added to the image data.

2

There are 2 best solutions below

1
On BEST ANSWER

If you are using the wordpress-mu-domain-mapping plugin, verify that the ./wp-content/sunrise.php file does not contain extra lines after the closing php tag.

0
On

Adding the following lines of code to wp-includes/ms-files.php before the readfile resolved the problem:

+ob_clean();
+flush();

// If we made it this far, just serve the file
readfile( $file );

Additional Reading: