Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/07/2009, 08:51
pollo_c2
 
Fecha de Ingreso: junio-2008
Mensajes: 50
Antigedad: 15 aos, 11 meses
Puntos: 0
problemas con errores al descargar un archivo del servidor

hola amigos saludos a todos!!!!!!!!!!!! tengo un problema, un archivo llamado prueba_zip.PHP incluye codigo para descargar archivos que se encuentran en el servidor!, este archivo prueba_zip lo he probado en dos computadoras y en una de ellas funciona a la perfeccion pero en la otra no, en la computadora que no funciona aparecen los siguientes errores:

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\fichtec\prueba_zip.php:10) in C:\AppServ\www\fichtec\prueba_zip.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\fichtec\prueba_zip.php:10) in C:\AppServ\www\fichtec\prueba_zip.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\fichtec\prueba_zip.php:10) in C:\AppServ\www\fichtec\prueba_zip.php on line 18

Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\fichtec\prueba_zip.php:10) in C:\AppServ\www\fichtec\prueba_zip.php on line 19

%PDF-1.4 % 12 0 obj<> endobj xref 12 29 0000000016 00000 n 0000001081 00000 n 0000000876 00000 n 0000001159 00000 n 0000001337 00000 n 0000001491 00000 n 0000001649 00000 n 0000001841 00000 n 0000001875 00000 n 0000002114 00000 n 0000002335 00000 n 0000002411 00000 n 0000002786 00000 n 0000003083 00000 n 0000003383 00000 n 0000003927 00000 n 0000004242 00000 n 0000004978 00000 n 0000005108 00000 n 0000005335 00000 n 0000005936 00000 n 0000006561 00000 n 0000007283 00000 n 0000007924 00000 n 0000010593 00000 n 0000010835 00000 n 0000017910 00000 n 0000018139 00000 n 0000018323 00000 n trailer <]>> startxref 0 %%EOF 14 0 obj<>stream xb```]  9v0a``qX^J[f2q*#镂b%^9MV8 GT6;(f`  Q % endstream endobj 13 0 obj<> endobj 15 0 obj<> endobj 16 0 obj<>/Font<>/ProcSet[/PDF/Text]/ExtGState<>>> endobj 17 0 obj<> endobj 18 0 obj<> endobj 19 0 obj[/ICCBased 35 0 R] endobj 20 0 obj<> endobj 21 0 obj<> endobj 22 0 obj<> endobj 23 0 obj<>stream HRN1S̬ϖ YwjQ" >c;z c׏#îl9 0*aB WtH! N<Ѭ&v0 TIJ7+ Sie4 ` }IWh1D r-x&lo{f< yZQ{gx}#x_2D-xjNˇz,9tJYҮ(΃U7*z¡urǍ `W+ k#kem֑wTq/v9etKpY>äMcsdA9 endstream endobj 24 0 obj<>stream H씱n0 C|E%KC%.n2g!!M l8(`*ϏG_SAL|l5=Xh"0 buT ؉iݗ6F* #[/( +,

otra cosa!! he modificado como unas dos opciones del php.ini no se de ahi venga el error!!, el archivo tiene la misma ruta en las dos computadoras C:/AppServ/www/fichtec/15.pdf !!!!, el codigo que uso en el archivo prueba_zip.php es el siguiente:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<?
//envia como descarga un archivo determinado
$file="C:/AppServ/www/fichtec/15.pdf";
header("Content-Disposition: attachment; filename=" . urlencode($file));
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Description: File Transfer");
header("Content-Length: " . filesize($file));
flush(); // this doesn't really matter.

$fp = fopen($file, "r");
while (!feof($fp))
{
echo fread($fp, 65536);
flush(); // this is essential for large downloads
}
fclose($fp);
echo"Descargando...";
?>
</body>
</html>

me pueden ayudar a identificar la causa del error!!!!