Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/10/2006, 05:55
Operadormail
 
Fecha de Ingreso: junio-2003
Mensajes: 778
Antigüedad: 20 años, 10 meses
Puntos: 1
Script forzar descarga no funciona

Hola todos.

Tengo este codigo

Código:
<? session_start();
include ("includes/seguridad.php"); 

require("../privado/php/configuracion.php");
$ref=$_GET["ref"];
$SQL="SELECT Archivo FROM apuntes WHERE Referencia='$ref'";
$con=mysql_query($SQL) or die (mysql_error());
$referencia=mysql_fetch_array($con);

$enlace = "../privado/docs/".$referencia ["Archivo"];
header ("Content-Disposition: attachment; filename=".$referencia ["Archivo"]."\n\n");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);
?>
Pero no consigo que descarge los ficheros. Se me abre una ventana del navegador y un monton de caracteres ilegibles

¿Ayuda?