d447c19429c6a31524d85ed36fafcad54bb0c63f
[brisk.git] / web / doc_download.php
1 <?php
2 require_once("Obj/brisk.phh");
3
4 function main()
5 {
6     GLOBAL $G_doc_path, $_GET; 
7
8     if (! isset($_GET['doc'])) {
9         return(FALSE);
10     }
11
12     $fname = sprintf("%s%s.pdf", $G_doc_path, basename($_GET['doc']));
13     if (! file_exists($fname)) {
14         return(FALSE);
15     }
16
17     header("Content-Type: application/octet-stream");
18     header(sprintf("Content-Disposition: attachment; filename=brisk_%s", basename($fname)));
19     readfile($fname);
20     return(TRUE);
21 }
22
23 main();
24 ?>