Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/12/2006, 11:53
Avatar de .php
.php
 
Fecha de Ingreso: julio-2006
Mensajes: 481
Antigüedad: 18 años, 7 meses
Puntos: 5
Re: Descarga forzada de archivos desde servidor.

mmm
prueba esto
Código PHP:
$carpeta="./schemes/"

if(
file_exists($carpeta.basename($_GET['file']))) 


   
$ruta $_GET["file"];             
   
$file=$carpeta.$_GET["file"]; 


   
header("Content-Transfer-Encoding: binary");   
   
header("Content-type: text/scriptlet");   
   
header("Content-Disposition: attachment; filename=".basename($file));   
   
header("Content-Length: ".filesize($file));     
   
readfile($file); 
   exit();

OJO le puse un exit para que no se siga ejecutando el codigo