I want to force the download of a big file (mp3), but the download stops after the middle of the filesize.
Waht can I do ?
Here is my script :
$filename = $titre.'.mp3';
$mime_type = (USR_BROWSER_AGENT == 'IE' || USR_BROWSER_AGENT == 'OPERA') ? 'application/octetstream' : 'application/octet-stream';
header('Content-Type: ' . $mime_type);
header("Content-Length: ".filesize($filename));
$content_disp = (USR_BROWSER_AGENT == 'IE') ? 'inline' : 'attachment';
header('Content-Disposition: attachment' /. $content_disp /. '; filename="' . $filename . '"');
header("Content-transfer-encoding: binary");
header('Pragma: no-cache');
header('Expires: 0');
// Send the file
$fp=fopen($filename, "r");
fpassthru($fp);