Error in function to force download by php

1

Hello, I have the code below for forcing and renaming media files to mp4 via remote URL download with all the download being corrupted as you are not downloading properly. How can I fix this because the file when 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); 
    
asked by anonymous 08.09.2015 / 16:29

1 answer

1

See if the attributes:

memory_limit, post_max_size, upload_max_filesize, max_execution_time

They are with the values you want in php.ini

    
08.09.2015 / 20:08