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? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.