File: /home/asjudine/public_html/afinanciera/descargar_archivos_fidelizacion.php
<?php
require_once("../Conectarse.php");
global $dbi;
$result = mysql_query('SELECT * FROM control_terminaciones_contratos WHERE id= "'.$_GET["id"].'" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($result)!=0))
{
$row = mysql_fetch_row($result);
$id = $row[0];
$nombre = $row[8];
$contenido = $row[9];
$tipo = $row[10];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido;
}
?>