File: /home/asjudine/public_html/descargar_archivos_respuesta_peticion_generico.php
<?php
require_once("mainfile.php");
require_once("Conectarse.php");
include ("config.php");
global $dbi;
$result = mysql_query('SELECT * FROM control_generico 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[45];
$contenido = $row[46];
$tipo = $row[47];
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido;
}
?>