MrProgrammer Posted October 11, 2014 Share Posted October 11, 2014 hello , this script for change download link and control fast download. tihs code is true but can't download with IDM(internet downlad manager) , what is problem? (i can't say english full , sorry) <?php $local_file = 'file.zip'; $download_file = 'download-name.zip'; $download_rate = 500; if(file_exists($local_file) && is_file($local_file)) { header('Cache-control: private'); header('Content-Type: application/octet-stream'); header('Content-Length: '.filesize($local_file)); header('Content-Disposition: filename='.$download_file); flush(); $file = fopen($local_file, "r"); while (!feof($file)) { print fread($file, round($download_rate * 1024)); flush(); sleep(1); } fclose($file); } else { die('Error: The file '.$local_file.' does not exist!'); }?> Link to comment Share on other sites More sharing options...
justsomeguy Posted October 13, 2014 Share Posted October 13, 2014 It's a little weird to slow down the download by sleeping like that, but you would probably need to contact IDM and ask them why it's not working. 1 Link to comment Share on other sites More sharing options...
Don Jajo Posted October 16, 2014 Share Posted October 16, 2014 header("Content-Disposition: attachment; filename="".$download_file."""); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now