llbra
Usuario Novato
Usuario Novato

I am trying to force a download of a document with header(). It went just allrigth in my home (test server - apache + php), but when I tested in miarroba nothing worked as I wanted. The gzcompress() funcition is not working, even saying in phpinfo() that miarroba supports it and the Content-Type: application/force-dowload and Content-Type: application/octet-stream didn´t worked.

Yo postei este tema en english porque yo no se hablar espanol muy bien. Alguna duvida con lo english yo posso ayudar


Here is the code I am using:

header( "Pragma: public" );
header( "Expires: 0" );
header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
header( "Content-Type: application/force-download" );
header( "Content-Type: application/octet-stream" );
header( "Content-Type: application/download" );
header( "Content-Disposition: attachment; filename=".basename($filename).";" );
header( "Content-Transfer-Encoding: binary" );
header( "Content-Length: ".filesize($filename) );

readfile( "$filename" );
exit();

Avatar Image
@man / @woman
@man / @woman

Maybe it's because mi@ add some html code to the end of the pages...

ATENCIÓN: Este tema no tiene actividad desde hace más de 6 MESES,
te recomendamos abrir un nuevo tema en lugar de responder al actual
Opciones:
Ir al subforo:
Permisos:
TU NO PUEDES Escribir nuevos temas
TU NO PUEDES Responder a los temas
TU NO PUEDES Editar tus propios mensajes
TU NO PUEDES Borrar tus propios mensajes
Temas similares
TemaUsuariosRespuestasVisitasActividad
Por: , el 23/Ago/2008, 05:46
GAmEOvEr_26CPC NoSetup.org User 356600132kAug/08