I have created HTML to Doc using php and header. It creates proper doc file what I want but when I download that doc file and click on SAVE AS its default type as webpage( .html).
Here is my code I am using to create doc file.
header('Content-Description: File Transfer');
header("Content-type: application/msword;charset=iso-8859-8");
header('Content-Disposition: attachment;filename=IEP-Annual-Goals.doc');
header("Pragma: no-cache");
header("Expires: 0");
$html='<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-8" />
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:Save>.doc</w:Save>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>';
// and main html block
//Then simply echo html to directly download doc file.
echo $html;
When I open doc file and save as, Its default type is web document(.html) but I need it as document(.doc) file.