2
Hello I have the code below to force and rename media files in mp4 via remote URL download with everything the download is coming corrupted as it is not performing the download properly. How can I fix this because the file while downloading is getting 2kbs in size.
$file = 'http://thumb.mais.uol.com.br/15328248.mp4';
$nome = 'novoNome.mp4';
header("Content-Description: File Transfer");
header("Content-Type: video/mp4");
header('Content-Disposition: attachment; filename="' . ($nome) . '";');
header('Content-Length: ' . strlen(file_get_contents($file)));
readfile($file);
Dude, I tested your code and the download worked normally, can’t it be something on your network that corrupted the download? does the test with smaller files or other types... in this link says to put ob_clean(); flush(); before readfile, see if it changes something for you....
– h3nr1ke
Here only worked with small files need it to work with large files in max up to 300mbs.
– Striffer