<?php
set_time_limit(0);

$file_name = "small_video.mp4";

header("HTTP/1.1 200 OK");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"{$file_name}\"");

$file_handle = fopen($file_name, 'rb');

// First, send 1MB of data with no throttling.
echo fread($file_handle, 1024 * 1024);

// Then, throttle the send rate to (1KB / 0.1s = 10 KB/s).
while (!feof($file_handle)) {
   echo fread($file_handle, 1024);
   usleep(100000);
}

fclose($file_handle);
?>