![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/10/2003, 07:13
|
![Avatar de Orgueira](http://static.forosdelweb.com/customavatars/avatar21239_1.gif) | | | Fecha de Ingreso: junio-2002 Ubicación: Coruña
Mensajes: 63
Antigüedad: 22 años, 8 meses Puntos: 0 | |
$dir = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
//aqui no se como poner
$filename=$dir . "../doc/" . "archivo.pdf";
$tarchivo=filesize($filename);
header("Content-Length: " . $tarchivo);
header("Content-Disposition: attachment; filename="."$filename");
header("Content-Type: text/txt");
$fp = fopen($filename,'rb');
este código pertenece al download.php que gestiona la descarga desde el servidor (no está completo pero si funciona con archivos en las carpetas del sitio). |