Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/06/2007, 19:56
Avatar de eft0
eft0
 
Fecha de Ingreso: junio-2003
Ubicación: Santiago - Chile
Mensajes: 635
Antigüedad: 20 años, 11 meses
Puntos: 9
Re: Descargar archivos

Lo que quieres hacer se le conoce como un "force download", y si se puede hacer, se logra modificando los headers del script PHP (que es por donde debes hacer la descarga, y no directamente del archivo txt). Los header son estos:

Código PHP:
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header ("Content-Type: application/octet-stream");
header ("Content-Length: " filesize('archivo.txt'));
header ("Content-Disposition: attachment; filename=archivo.txt");
readfile("archivo.txt"); 
Suerte.