jake2891 Posted September 4, 2009 Share Posted September 4, 2009 Hey guys, Have the following code below which used to work in ie and firefox but now only works in firefox. its very strange. basically im executing the below code in a popup that open up a file in word. in ie its just opening the popup then doing nothing. and in firefox its opening the word document. any help please ?? header("Content-Type: application/msword"); header("Content-Disposition: attachment; filename=test.doc" ); print file_get_contents($path); exit; Link to comment https://forums.phpfreaks.com/topic/173098-header-msword-help/ Share on other sites More sharing options...
Adam Posted September 4, 2009 Share Posted September 4, 2009 Where's $path come from? Link to comment https://forums.phpfreaks.com/topic/173098-header-msword-help/#findComment-912370 Share on other sites More sharing options...
PFMaBiSmAd Posted September 4, 2009 Share Posted September 4, 2009 The filename needs to be enclosed in quotes to make it a valid header - header('Content-Disposition: attachment; filename="test.doc"'); Link to comment https://forums.phpfreaks.com/topic/173098-header-msword-help/#findComment-912375 Share on other sites More sharing options...
jake2891 Posted September 4, 2009 Author Share Posted September 4, 2009 $path is just set to the directory storing the document. $path = '/dir/dir/dir/1.doc'; tried with quotes too but still no luck. and i j=dont have any javascript errors in the popup either. Link to comment https://forums.phpfreaks.com/topic/173098-header-msword-help/#findComment-912382 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.