forked from librespeed/speedtest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgarbage.php
More file actions
24 lines (24 loc) · 761 Bytes
/
Copy pathgarbage.php
File metadata and controls
24 lines (24 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// Disable Compression
@ini_set('zlib.output_compression', 'Off');
@ini_set('output_buffering', 'Off');
@ini_set('output_handler', '');
// Headers
header( "HTTP/1.1 200 OK" );
// 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
$data=openssl_random_pseudo_bytes(1048576);
// Deliver chunks of 1048576 bytes
for($i=0;$i<intval($_GET["ckSize"]);$i++){
echo $data;
flush();
}
?>