Some (most) of downloaded pictures came corrupted (completelly different binary file, but of the right size). After investigation, it looks like we need to "ob_clean — Clean (erase) the output buffer" and "flush — Flush system output buffer" before doing readfile().

This commit is contained in:
Adrian Siemieniak
2017-03-22 22:22:46 +01:00
committed by Pierrick Le Gall
parent eacad2a4b8
commit f09e3e7c0a

View File

@@ -220,7 +220,9 @@ if (ini_get('safe_mode') == 0)
{
@set_time_limit(0);
}
// Without clean and flush there may be some image download problems, or image can be corrupted after download
ob_clean();
flush();
@readfile($file);
?>
?>