Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/07/2009, 17:14
horape
 
Fecha de Ingreso: mayo-2009
Mensajes: 210
Antigüedad: 15 años
Puntos: 0
Respuesta: Forzar descarga

yo uso esto

Código php:
Ver original
  1. if (file_exists($file)) {
  2.     header('Content-Description: File Transfer');
  3.     header('Content-Type: application/octet-stream');
  4.     header('Content-Disposition: attachment; filename='.basename($file));
  5.     header('Content-Transfer-Encoding: binary');
  6.     header('Expires: 0');
  7.     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  8.     header('Pragma: public');
  9.     header('Content-Length: ' . filesize($file));
  10.     ob_clean();
  11.     flush();
  12.     readfile($file);
  13.     exit;
  14. }

no se si habra casos en que no sirve, proba