Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a MSWord doc

Status
Not open for further replies.

DreamerZ

Programmer
Jul 11, 2001
254
0
0
US
I've searched through several pages of posts after searching keywords like, "converting Word document to HTML php." I've read the htmlentities and html_entity_decode functions on php.net as well as the COM information. I've even tried some of the functions listed in the posts for those functions. Nothing has worked. I get squares and funky characters displayed on the page along with the text in the document, like this: ÐÏࡱá>þÿ þÿÿÿ

All I want to do is display a Word doc on the screen. I'm providing an upload function and then want to display that uploaded document in the browser. Right now, I'm just dealing with Word documents. Uploading HTML documents and then using include($docName) works fine since the browser does the decoding work of the HTML document. I'm okay with the virus check box that pops up asking to OPEN, SAVE, etc. when normally opening a Word doc with a browser. I just want to display the doc. If I can convert it to HTML that's fine too.

FYI: Server is UNIX, PHP version is 4.2.2 (on the test sytem that I'm using, not sure about the live server), every client that will use these pages has MS Word installed and is using Internet Explorer (I can guarantee that as it's a company standard), and site can only be accessed from internal corporate networks.

So, how can I convert a MS Word doc to HTML to view or open the Word doc in the browser with PHP?

Thoughts? TIA.


DreamerZ
 
You want people to open Word docs though clicking on a link?
Then there's nothing necessary. If they all have IE and Word and the Windoes boxes are setup correctly they will recognize it and use the default application.
There seems to be absolutely no need to do anything else than that - unless you tell us what the additional problem is.
 
I'm sorry if I wasn't clear. I said, "I'm providing an upload function and then want to display that uploaded document in the browser."

After selecting the file to upload and then clicking the button to upload that file, the next screen is to display the document automatically, not by clicking on a link.

That help?


DreamerZ
 
1. Upload - make no output to the screen.
2. If successful, redirect to the uploaded file URL using a header directive with HTTP status code 301.

That should work. However, I'm not entirely sure if that makes sense (at least to me). Upload a file, then download the file to display it?
 
heh. I overthought the problem/solution. A simple redirect was the way to go. Upload the document then echo <script>window.location=$file</script>.

Thx,


DreamerZ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top