File: /home/asjudine/public_html/descargar_archivos_contrato_correo.php
<?php
require_once("mainfile.php");
require_once("Conectarse.php");
include ("config.php");
global $dbi;
$result = mysql_query('SELECT * FROM consulta_contratos WHERE cedula= "'.$_GET["cedula"].'" and id= "'.$_GET["id"].'" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($result)!=0))
{
$row = mysql_fetch_row($result);
$cedula = $row[0];
$nombre = $row[2];
$contenido = $row[3];
$tipo = $row[4];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido;
}
?>