Jump to content

change download links


MrProgrammer

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...