Ver Mensaje Individual
  #8 (permalink)  
Antiguo 05/04/2010, 11:03
jorgegetafe
 
Fecha de Ingreso: febrero-2008
Ubicación: Madrid
Mensajes: 474
Antigüedad: 16 años, 3 meses
Puntos: 1
Respuesta: Dar fichero al cliente sin crearlo en el servidor

Cita:
Iniciado por GatorV Ver Mensaje
No es posible hacerlo
¿Y esta solución? La he encontrado en el foro.
Código PHP:
<?php
    error_reporting
(0);
    
$f $_POST['archiv'];
    
$ruta $_POST['directorio'];
    
$ruta '../../'.$ruta;
    
$ruta $ruta.'/';
    
header("Content-type: application/octet-stream");
    
header("Content-Disposition: attachment; filename=\"$f\"\n");
    
$fp=fopen($ruta."$f""r");
    
fpassthru($fp);
    
register_shutdown_function("borrado");     

    function 
borrado(){
      global 
$fp$f;
      
$ruta $_POST['directorio'];
      
fclose($fp);
      
$archivo_a_borrar="/wamp/www/".$ruta."/".$f;
      
unlink($archivo_a_borrar);
    }
?>