
20/04/2007, 12:46
|
| | Fecha de Ingreso: abril-2007
Mensajes: 15
Antigüedad: 17 años, 10 meses Puntos: 0 | |
Descarga de Archivos Codigo PHP Hola a todos, resulta que uso este Codigo para bajar ficheros, (Doc, txt, Pdf, etc)
<?php
$enlace = $path_a_tu_doc."/".$id;
header ("Content-Disposition: attachment; filename=".$id."\n\n");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);
?>
Lo hace todo bien, descargas el archivo, en su formato y todo con su nombre pero cuando lo abres, el contenido del fichero no es el real sino este:
<br />
<b>Warning</b>: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for \\servidor\CARPETA TRABAJO\2.1-EMPRESAS CONTRATADAS\15. ARCHIVOS WEB\subcarpeta\Nuevo Mod Consejeria Hac.doc in <b>C:\AppServ\www\gestion\wind\desc.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\gestion\wind\desc.php:9) in <b>C:\AppServ\www\gestion\wind\desc.php</b> on line <b>9</b><br />
<br />
<b>Warning</b>: readfile(\\servidor\CARPETA TRABAJO\2.1-EMPRESAS CONTRATADAS\15. ARCHIVOS WEB\subcarpeta\Nuevo Mod Consejeria Hac.doc) [<a href='function.readfile'>function.readfile</a>]: failed to open stream: No such file or directory in <b>C:\AppServ\www\gestion\wind\desc.php</b> on line <b>10</b><br />
POR FAVOR AYUDAAA |