Ver Mensaje Individual
  #4 (permalink)  
Antiguo 27/03/2008, 15:36
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Ayuda para evitar descarga de archivos fuera de una aplicacion

Puedes probar con esto:
Código PHP:
$filename "/path/a/tu/archivo.exe";
$download "archivo.exe";

if( !
file_exists$filename ) ) {
        
header"Status: 404" );
        die( 
"No se encontro el fichero" );
}
header("Last-Modified: " gmdate("D, d M Y H:i:s T"filemtime($filename)));
header("Accept-Ranges: bytes");
header("Content-Length: " filesize($filename));
header("Content-Disposition: attachment; filename=" $download);
readfile($filename); 
También te invito a que leas las FAQs del foro.

Saludos.