Belki bir bellek / dosyaboyu hata içine çalıştırıyorsunuz? Ben readfile ile geçmiş damping dosyaların büyük sorunlar yaşadım. Content-Length üstbilgisi ayarlamaya ek olarak, ben bir tampon içine dosyayı okumuyor gibi, fpassthru()
a> kullanmanızı öneririz, sadece onu döker.
set_time_limit(0); // disable timeout
$file = $root_path.'/full-tile-book.pdf';
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="NewName.pdf"');
header('Content-Length: ' . filesize($file));
session_write_close(); // remove this line if sessions are not active
$f = fopen($file, 'rb');
fpassthru($f);
fclose($f);
exit;
EDIT: Eğer herhangi sessions_code kullanıyorsanız, bu dosya dökümü işlemine başlamadan önce oturumu sona erdirmek için iyi bir fikirdir. Ben bunu yansıtmak benim örnek güncelledik.