Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/07/2009, 08:51
pollo_c2
 
Fecha de Ingreso: junio-2008
Mensajes: 50
Antigüedad: 18 años, 3 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 xÚb```¢] ¬ Óø€�� 9v0¼óa``qX^Jþ[ªfÈ2q�*…È#é•‚b%^–9†œ˜MÄ´¸V8‘ÐÓõƒ‡á àŽÉGT¿ª6;(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 H‰ìR¹N1íýSŠÉ̬ϖ€�� YwˆjQ"¢ �‹ü>c;�„z ´ÚãÉï˜c×�#lÖ9 0ä*aB ½úWtH†ˆì! ÁNï<ÕÇѬà&ï«Øv±0† TIJ¿7+®„ ØSiÆeú4 `× }„ƒI£Wh1À¬¥D r-ºx&Ï×ÚÙlo{Èf<…Œ› yÒÊöZ�ˆÀQ{‚gx}#x_2º˜D-xŸÐûjêÐN°Ë‡z,ÈÐ9tõøJÜYÒ®(ÁáÐ΃U7¦„¢*z¡Ûu¬½rÇ�® ú`W·êõ+ ÿÿký#keòmšÎÖ‘w¿Tq¬/ÈÐvñ�9µetþüKªpYË>äM¹csdA9ÃÙÀ—ïÉÏ endstream endobj 24 0 obj<>stream H‰ì”±nÄ0 C÷|Eæ„%K²üC�Òéþ¨%û.¹n2�‚g“„!!êÛM lû±ÑâÚÑ8¸(ú`*ðàÏ�G_ÃÂàSA¿L|lÄ5=âXÂh"0 ýbuÈäT« ؉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!!!!