diff --git a/cms/dms.php b/cms/dms.php new file mode 100644 index 000000000..45c4db772 --- /dev/null +++ b/cms/dms.php @@ -0,0 +1,50 @@ +, + * Andreas Oesterreicher and + * Karl Burkhart . + */ +require_once('../config/cis.config.inc.php'); +require_once('../include/dms.class.php'); + +if(!isset($_GET['id'])) + die('ID muss uebergeben werden'); + +$id = $_GET['id']; + +if(!is_numeric($id)) + die('ID ist ungueltig'); + +$doc = new dms(); +if(!$doc->load($id)) + die('Dieses Dokument existiert nicht mehr'); + +if($handle = fopen(DMS_PATH.$doc->filename,"r")) +{ + header("Content-type: ".$doc->mimetype); + header('Content-Disposition: attachment; filename="'.$doc->name.'"'); + + while (!feof($handle)) + { + echo fread($handle, 8192); + } + fclose($handle); +} +else + echo 'Fehler: Datei konnte nicht geoeffnet werden'; +?> \ No newline at end of file diff --git a/include/dms.class.php b/include/dms.class.php index 01d6c806c..202529f94 100644 --- a/include/dms.class.php +++ b/include/dms.class.php @@ -75,7 +75,7 @@ class dms extends basis_db { $this->dms_id = $row->dms_id; $this->version = $row->version; - $this->oe_kurzbz = $row->kurzbz; + $this->oe_kurzbz = $row->oe_kurzbz; $this->dokument_kurzbz = $row->dokument_kurzbz; $this->kategorie_kurzbz = $row->kategorie_kurzbz; $this->filename = $row->filename;