0
votes

I used php to create a Word file with the extension .doc using HTML content. When I open the document it opens fine but when I try to Save As in dialog box it shows "Web Page" as the "Save as" type.

I used code like this https://stackoverflow.com/a/13340217, https://daveismyname.blog/create-a-doc-file-with-php-on-the-fly

But I need it to default to the Word Document type of Word 97-2003 Document because the user can't observe this format while saving.

I've attached an image of this issue:

Save-as-type-issue-IMAGE

enter image description here

(Note: That code needs some changes in php headers and html head tag elements.)

Can anyone provide a suggestion to solve this issue?

1
If you really want a Word document that MS Word will teat as a word document, then you need to create a word document, not a block of html masquerading as a word document because it has a .doc extension.... MS Word doesn't know that your document should be saved as a word document because it isn't really a word document, it's html markup, so it treats it as suchMark Baker

1 Answers

-1
votes

Look at "tools", at "save as" window, and save as specified format.