File: /home/asjudine/public_html/descargar_archivos_viaticos.php
<?php
require_once("Conectarse.php");
include ("config.php");
global $dbi;
$result = mysql_query('SELECT nombre, contenido, tipo FROM viaticos WHERE solicitud_no = "'.$_GET["solicitud"].'" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($result)!=0))
{
list($nombre, $contenido, $tipo) = mysql_fetch_row($result);
// $cedula = $row[0];
// $nombre = $row[38];
// $contenido = $row[39];
// $tipo = $row[40];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido;
}
?>