dennismonsewicz Posted December 11, 2009 Share Posted December 11, 2009 header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename("/tmp/mytest.xls")); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize("/tmp/mytest.xls")); readfile("/tmp/mytest.xls"); The code above does not force download the file, rather it displays the results on the screen... is this a problem of the headers not sending? Link to comment https://forums.phpfreaks.com/topic/184789-force-download-problems/ Share on other sites More sharing options...
cags Posted December 11, 2009 Share Posted December 11, 2009 When it appears on screen do you see any error messages? Infact do you have error_reporting and display_errors set-up appropriately? Link to comment https://forums.phpfreaks.com/topic/184789-force-download-problems/#findComment-975572 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.