Ver Mensaje Individual
  #5 (permalink)  
Antiguo 12/09/2011, 14:54
Avatar de mayid
mayid
Colaborador
 
Fecha de Ingreso: marzo-2009
Ubicación: BsAs
Mensajes: 4.014
Antigüedad: 15 años, 1 mes
Puntos: 101
Respuesta: fopen escribe el nombre del archivo en primera linea!

Encontré el error! Al forzar la descarga del archivo tenía un echo $file antes de todo esto:

Código PHP:
Ver original
  1. header('Pragma: public');     // required  
  2.     header('Expires: 0');        // no cache  
  3.     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');  
  4.     header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($file)).' GMT');  
  5.     header('Cache-Control: private',false);  
  6.     header('Content-Type: '.$type);  
  7.     header('Content-Disposition: attachment; filename="'.basename($file).'"');  
  8.     header('Content-Transfer-Encoding: binary');  
  9.     header('Content-Length: '.filesize($file));  
  10.     header('Connection: close');  
  11.     readfile($file);  
  12.     exit();

Como esto termina con readfile(), el script estaba tomando la linea de debug como parte del contenido a bajar. :(