b6b70358a08102461aac4e4acfbf5510ec4c9347
[racktables] / download.php
1 <?php
2 require 'inc/init.php';
3
4 if (empty($_REQUEST['file_id']))
5 {
6 showError ("Invalid file specified", __FILE__);
7 die();
8 }
9
10 $pageno = 'file';
11 $tabno = 'default';
12 fixContext();
13 if (!permitted())
14 {
15 showError ("Permission denied", __FILE__);
16 die();
17 }
18
19 $file = getFile($_REQUEST['file_id']);
20 if ($file != NULL)
21 {
22 header("Content-Type: {$file['type']}");
23 header("Content-Length: {$file['size']}");
24 header("Content-Disposition: attachment; filename={$file['name']}");
25 echo $file['contents'];
26 }
27 ?>