I am trying to download 700mb file using the following code
header("Pragma: public", true);
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=".basename($File));
header("Content-Type: application/download");
header("Content-Description: File Transfer");
header("Content-Length: " . filesize('movies/'.$File));
flush();
$fp = fopen('movies/'.$File, "r");
while (!feof($fp))
{
echo fread($fp, 65536);
flush();
}
fclose($fp);
but this is taking too long to start downloading file, it takes about 2-3 minutes to start the download. This code is just for mkv file, other video files are working perfect with location header.
File is not downloading without any of the content-type header missing
I want to start downloading fast