root/trunk/RackTables/download.php

Revision 2276, 373 bytes (checked in by aaron, 2 months ago)

added support for file attachments (re: ticket 56)

Line 
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 ?>
19
Note: See TracBrowser for help on using the browser.