Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/10/2008, 05:31
Avatar de jaronu
jaronu
 
Fecha de Ingreso: febrero-2008
Mensajes: 2.183
Antigüedad: 16 años, 2 meses
Puntos: 52
Respuesta: Descargar archivo generado con php

algo asi

Código PHP:

<?php $ruta $_GET['ruta'];
$archivo_arr explode"/"$ruta );
$archivo $archivo_arr[count($archivo_arr) - 1];

if( !
file_exists$ruta ) ) {
         die( 
"No existe $ruta" );
}

header"Content-Disposition: attachment; filename=".$archivo."");
header"Content-type: application/octet-stream" ); 

@
readfile$ruta );  
?>