js: add confirm function attributes to notify_document class, php: add document downl...
[brisk.git] / web / doc_download.php
diff --git a/web/doc_download.php b/web/doc_download.php
new file mode 100644 (file)
index 0000000..d447c19
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+require_once("Obj/brisk.phh");
+
+function main()
+{
+    GLOBAL $G_doc_path, $_GET; 
+
+    if (! isset($_GET['doc'])) {
+        return(FALSE);
+    }
+
+    $fname = sprintf("%s%s.pdf", $G_doc_path, basename($_GET['doc']));
+    if (! file_exists($fname)) {
+        return(FALSE);
+    }
+
+    header("Content-Type: application/octet-stream");
+    header(sprintf("Content-Disposition: attachment; filename=brisk_%s", basename($fname)));
+    readfile($fname);
+    return(TRUE);
+}
+
+main();
+?>
\ No newline at end of file