diff options
author | deva <deva> | 2008-10-06 18:13:56 +0000 |
---|---|---|
committer | deva <deva> | 2008-10-06 18:13:56 +0000 |
commit | 415e90a2e059ea32f6851dfb9b3c018b0a731a81 (patch) | |
tree | a2e7d809f4783f521a3a985716a26a6543acfc9d /forum/htdocs/file.php | |
parent | cce5e7710295021b41d9aaecc503a60fb99256be (diff) |
Put the webpages in.
Diffstat (limited to 'forum/htdocs/file.php')
-rw-r--r-- | forum/htdocs/file.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/forum/htdocs/file.php b/forum/htdocs/file.php new file mode 100644 index 0000000..abf02fb --- /dev/null +++ b/forum/htdocs/file.php @@ -0,0 +1,27 @@ +<?php + +include_once("config.php"); +include_once($UTIL_DIR . "/mimetypes.php"); +include_once($UTIL_DIR . "/files.php"); + +$files = new Files($DATA_DIR . "/files.xml"); +$file = $files->getFile($fid); + +$filename = $PERMSTORE . "/" . $file->fid; + +$download = false; +foreach($MIME_TYPES as $m) { + if($m->name == $file->mimetype) $download = !$m->show; +} + +//header ("Cache-Control: must-revalidate, post-check=0, pre-check=0"); +header('Content-Description: File Transfer'); +header('Content-Type: ' . $file->mimetype); +header('Content-Length: ' . filesize($filename)); + +if($download) header('Content-Disposition: attachment; filename=' . basename($file->name)); +else header('Content-Disposition: inline; filename=' . basename($file->name)); + +readfile($filename); + +?>
\ No newline at end of file |