summaryrefslogtreecommitdiff
path: root/sample.php
blob: 1d534dd1584f0792e5203063dae1956682bef232 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

$filename = $_SERVER['DOCUMENT_ROOT'] . "/packages/sample.zip";

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header("Cache-Control: no-cache, must-revalidate");
header("Expires: 0");
header('Content-Disposition: attachment; filename="sample.zip"');
header('Content-Length: ' . filesize($filename));
header('Pragma: public');

//Clear system output buffer
flush();

//Read the size of the file
readfile($filename);

//Terminate from the script
die();