Forums / Developer / Headers in module ? / Comment66328

Author Topic

Fou Jino

Wednesday 02 March 2011 1:08:59 am

Comment66328

Nop Peter, but I found a solution ;

ob_start();

$path = "[...]";

$file = "[...]"

$filesize = filesize($path.$file);

if(file_exists($path.$file)) {

header('Content-type: application/force-download');

header('Content-disposition: attachment; filename="'. $file .'"');

header('Content-length: '. $filesize ); readfile( $path.$file );

}

ob_end_flush();

I used ob_start() & ob_flush to active output buffering, and it works perfectly :)

Foujino ~ http://www.foujino-blog.be