fix missing bold for your account item
[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     $ext = "pdf";
13     $cont_type = "application/octet-stream";
14     if (isset($_GET['ext']) && ($_GET['ext'] == "txt")) {
15         $cont_type = "plain/text";
16         $ext = $_GET['ext'];
17     }
18
19     $fname = sprintf("%s%s.%s", $G_doc_path, basename($_GET['doc']), $ext);
20     if (! file_exists($fname)) {
21         return(FALSE);
22     }
23
24     header(sprintf("Content-Type: %s", $cont_type));
25     header(sprintf("Content-Disposition: attachment; filename=brisk_%s", basename($fname)));
26     readfile($fname);
27     return(TRUE);
28 }
29
30 main();
31 ?>