Ver Mensaje Individual
  #12 (permalink)  
Antiguo 08/11/2006, 14:57
Avatar de AbdelioR
AbdelioR
 
Fecha de Ingreso: septiembre-2006
Ubicación: Tarragona
Mensajes: 926
Antigüedad: 17 años, 7 meses
Puntos: 8
Bueno, al fin lo he conseguido. Mi script final, al que le paso el nombre del fichero como parametro, es este:

Código PHP:

<?php

$carpeta
="./schemes/";

if(
file_exists($carpeta.basename($_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);
}
else
{
 echo 
"Usted esta accediendo a un archivo que no existe en la carpeta de descargas. El fichero ke kieres se llama $fichero";
}
?>
Saludos ^^