Foros del Web » Programando para Internet » PHP »

Download

Estas en el tema de Download en el foro de PHP en Foros del Web. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código php: Ver original header ( 'Content-Description: File Transfer' ) ; header ( 'Content-Type: application/octet-stream' ) ; header ( 'Content-Disposition: attachment; filename=' . ...
  #1 (permalink)  
Antiguo 06/10/2009, 07:25
 
Fecha de Ingreso: mayo-2009
Mensajes: 210
Antigüedad: 15 años
Puntos: 0
Download

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

En vez de "Save File" me sale seleccionado "Open File" y tengo q cambiarlo a mano.
Qué tengo mal??
  #2 (permalink)  
Antiguo 06/10/2009, 08:57
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Respuesta: Download

Nada, ese es comportamiento del cliente y no puedes cambiarlo desde PHP.

Saludos.
  #3 (permalink)  
Antiguo 06/10/2009, 20:28
Avatar de mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 8 meses
Puntos: 214
Respuesta: Download

!!
Hola
Te recomendaria hacerte un archivo download.php para que no se ejecute el open sino que lo descargues
Revisate esto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:27.