X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/631e99d6b2c669a7a160ea80e5355a54de839116..614fb545c1c1efce6cacf14b8c20c17032268604:/sistema/www/servicios/informes/get_file.php diff --git a/sistema/www/servicios/informes/get_file.php b/sistema/www/servicios/informes/get_file.php index 031bcaa..c0446af 100755 --- a/sistema/www/servicios/informes/get_file.php +++ b/sistema/www/servicios/informes/get_file.php @@ -9,19 +9,11 @@ informes sin utilizar MEconDAV Myrna Degano ------------------------------------------------------------------------------*/ -require_once 'DB.php'; - -//Conexión a la BD -$dbh = DB::connect("mysql://mark:mark@intranet-db/MEconDAV"); -if (DB::isError($dbh)) { - die ($dbh->getMessage()); -} - //Obtener Datos del Adjunto $sql = "SELECT mimetype, filename, size - FROM FilesForArticle + FROM MEconDAV.FilesForArticle WHERE file_for_article_id = ". $_GET['id']; -$datos = $dbh->getAll($sql); +$datos = $DB->getAll($sql); $mime = $datos[0][0]; $filename = $datos[0][1]; @@ -32,10 +24,10 @@ $dir = '/var/www/mecondav/archivos/'; $dir = $dir.$_GET['id']; header("Content-Type: ".$mime); -//header("Content-Disposition: attachment; filename=".$filename); +header("Content-Disposition: attachment; filename=".$filename); header("Pragma: no-cache"); header("Expires: 0"); header("Content-Length: ".$filesize); readfile ($dir); -?> \ No newline at end of file +?>