<?php
include("conexion_inter.php");
$result = mysql_query('SELECT nombre, tipo, contenido FROM archivos_tickets WHERE id= "'.$_GET["id"].'" ');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
if ((mysql_num_rows($result)!=0))
{
list($nombre, $tipo, $contenido) = mysql_fetch_row($result);
header("Content-type: $tipo");
header("Content-Disposition: attachment; filename=$nombre");
print $contenido;
}
?>