Co jest zaletą, a różnica między:Jaka jest korzyść z fragmentów "echo", podczas gdy plik jest urywany?
komunikat 1:
header("Content-type: image/jpeg");
header('Expires: ' . date('r',time() + 864000));
header("Pragma: public");
header("Cache-Control: public");
header("Content-Length: " . strlen($contents));
$splitString = str_split($contents, 1024);
foreach($splitString as $chunk)
echo $chunk;
komunikat 2:
header("Content-type: image/jpeg");
header('Expires: ' . date('r',time() + 864000));
header("Pragma: public");
header("Cache-Control: public");
header("Content-Length: " . strlen($contents));
echo $contents;
Jest to omawiane tutaj również: http://stackoverflow.com/questions/4425227/forced-downloading-large-file-with-php –