Advertisement
Shad0w

Untitled

Nov 30th, 2011
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. $file = "file.rar";
  3. $speed = 50; // מהירות הורדה
  4. if(file_exists($file) && is_file($file)) {
  5.    header("Cache-control: private");
  6.    header("Content-Type: application/octet-stream");
  7.    header("Content-Length: ".filesize($file));
  8.    header("Content-Disposition: filename=$file" . "%20");
  9.    flush();
  10.    $fd = fopen($file, "r");
  11.    while(!feof($fd)) {
  12.       echo fread($fd, round($speed*1024));
  13.       flush();
  14.       sleep(1);
  15.    }
  16.    fclose ($fd);
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement