2016-03-04 11:48:09 +00:00
|
|
|
<?php
|
2016-11-28 20:09:12 +00:00
|
|
|
// Disable Compression
|
2016-10-22 13:21:16 +00:00
|
|
|
@ini_set('zlib.output_compression', 'Off');
|
|
|
|
@ini_set('output_buffering', 'Off');
|
|
|
|
@ini_set('output_handler', '');
|
|
|
|
// Headers
|
2016-03-04 11:48:09 +00:00
|
|
|
header( "HTTP/1.1 200 OK" );
|
2016-10-22 13:21:16 +00:00
|
|
|
// Download follows...
|
|
|
|
header('Content-Description: File Transfer');
|
|
|
|
header('Content-Type: application/octet-stream');
|
|
|
|
header('Content-Disposition: attachment; filename=random.dat');
|
|
|
|
header('Content-Transfer-Encoding: binary');
|
|
|
|
// Never cache me
|
|
|
|
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
|
|
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
|
|
header("Pragma: no-cache");
|
|
|
|
// Generate data
|
2016-12-29 06:49:46 +00:00
|
|
|
$data=openssl_random_pseudo_bytes(1048576);
|
2016-11-28 20:09:12 +00:00
|
|
|
// Deliver chunks of 1048576 bytes
|
2016-03-04 11:48:09 +00:00
|
|
|
while(1){
|
2016-10-22 13:21:16 +00:00
|
|
|
echo $data;
|
|
|
|
flush();
|
2016-03-04 11:48:09 +00:00
|
|
|
}
|
|
|
|
?>
|