ReadFile download file plus Ob_clean effect
ReadFile Examples in the manual
$file = ' 12.jpg ';
if (file_exists ($file)) {
Header (' Content-description:file Transfer ');
Header (' Content-type:application/octet-stream ');
Header (' content-disposition:attachment; Filename= '. basename ($file));
Header (' content-transfer-encoding:binary ');
Header (' expires:0 ');
Header (' cache-control:must-revalidate ');
Header (' Pragma:public ');
Header (' Content-length: '. FileSize ($file));
Ob_clean ();
Flush ();
ReadFile ($file);
Exit ();
}
What is the effect of adding ob_clean and flush here? Do not add also can download, add no difference
------Solution--------------------
If said Ob_clean (); Clear the buffer, with some reason.
then flush (); Out of the output buffer, it makes no sense.
Because in any case, the contents of the output buffer are to be output.