File: /home/asjudine/public_html/abogados/descargar_requerimientos.php
<?php
global $dbi;
require_once("../Conectarse.php");
//$query_Recordset1 = "SELECT * FROM archivos where id = $Id";
//$Recordset1 = mysql_query($query_Recordset1, $dbi) or die(mysql_error());
$result = mysql_query('SELECT * FROM archivosrequerimientos WHERE id = "' . $_GET["Id"] . '"');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
// if ((mysql_num_rows($Recordset1)!=0))
// {
// list($Id, $nombre, $fechar, $hora, $contenido, $tipo, $Identificacion, $registro, $registro_interno) = mysql_fetch_row($Recordset1);
$row = mysql_fetch_row($result);
$id = $row[0];
$nombre = $row[2];
$contenido = $row[5];
$tipo = $row[6];
// }
/* $nombre = mysql_result($Recordset1, 0, "nombre");
$tipo = mysql_result($Recordset1, 0, "tipo");
$contenido = mysql_result($Recordset1, 0, "contenido");*/
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido;
//echo $contenido;
?>