Jump to content
  • 0

ostatní omezení rychlosti stahování


rhsCZ

Dotaz

5 odpovědí na tuto otázku

Recommended Posts

  • 0
 header('Cache-control: private');
   header('Content-Type: application/octet-stream');
   header('Content-Length: '.filesize($local_file));
   header('Content-Disposition: filename='.$download_file);

   // flush content
   flush();   
   // open file stream
   $file = fopen($local_file, "r");   
   while(!feof($file)) {

    // send the current file part to the browser
    print fread($file, round($download_rate * 1024));   

    // flush the content to the browser
    flush();

    // sleep one second
    sleep(1);   
   }   

   // close file stream
   fclose($file);}

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...