I created a file download script in PHP, it works, but web browsers report the file as \"Unknown Length\". My code is as follows:
function downloadFile($fil
I had this same problem, and I fixed it by sending the Content-Length header before the Content-Disposition.
header('Content-Type: video/mp4');
header("Content-Transfer-Encoding: Binary");
header("Content-Length: ".filesize($file_url));
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
readfile($file_url);