r2276 added support for file attachments (re: ticket 56)
[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 $file = getFile($_REQUEST['file_id']);
11 if ($file != NULL)
12 {
13 header("Content-Type: {$file['type']}");
14 header("Content-Length: {$file['size']}");
15 header("Content-Disposition: attachment; filename={$file['name']}");
16 echo $file['contents'];
17 }
18 ?>