Upload Word DOCX file, convert to mhtml

Currently I can save a DOCX file in Word as a mhtml file (single webpage), then upload the file using PHP and display it on the webpage. I am looking for the ability to allow the user to directly upload the Word DOCX file and perform the conversion for them.

Any ideas on a PHP script of some sort that can do the conversion?

Hi @davidbarman26 and a warm welcome to the forum.

A quick Google search revealed the following which I have not tried. Let us know if it solves your problem.

https://stackoverflow.com/questions/4587216/how-can-i-convert-a-docx-document-to-html-using-php#6644539

Thanks for the reply. I have seen the posting already. Some of the suggestions are not applicable (like Print2Flash - from what I gather it requires the site to run on a Windows machine). Some of the other options either only return raw text or are expensive software solutions.

I am looking for a low cost solution that will return formatted solution. Currently, I have found an MHT to HTML converter. I am able to upload an MHT file (I export the DOCX file to MHT using MS Word), and using the script I am able to display the contents on a web page. What I am hoping is to remove the need to us MS Word to convert the DOCX file to MHT.

So either a conversion tool that I can incorporate into the site that will either directly convert DOCX to formatted HTML or at least to an MHT file where I can use the existing script to complete the conversion.;

1 Like