0
votes

I'm building a php application for intranet only use. I'm accessing network drives and listing the files.

Since chrome and FF do not have built-in functions to open Windows Explorer (I know there are extensions available). I was hoping to have php code recognize the file is a word application file (.doc, .docx, etc...) and then launch the user's Microsoft Word Application to open the file.

I've looked into PHPWord, but the documentation is terrible.

Is there a way (other than having each user download an extension) to be able to open a MS Word file using PHP?

2
Not using php as requested but: stackoverflow.com/questions/2800081/… gives a solution.TomFirth
It helps - but it will only download the file and not open it. Thank you for the suggestion though.bagofmilk

2 Answers

0
votes

PHPWord development is continued in github. Please checkout the latest version of the develop branch.

0
votes

It looks like you're just wanting to stream a ms word doc to the browser and have the browser open the document in MS word. That can be accomplished by setting the content type headers properly and then outputting the contents of the file.
This: https://www.devside.net/wamp-server/forcing-a-pdf-or-doc-to-open-in-browser-rather-than-downloading might help Also, depending on browser and how it is streamed out, you might have an option in the browser to either Open the file, or save the file. If you set the user's browsers to "open the file" then you are set.