Read the MSword file form PHP and display in browser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raveendran
Forum Newbie
Posts: 3
Joined: Tue May 06, 2008 5:23 am

Read the MSword file form PHP and display in browser

Post by raveendran »

Hai,

I would like to read the MSword file(.doc) and display on the browser.

I used the following lines to read

$filename = "c:\\sample.doc";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));

but it showed me in the some other format.

Afterwards i google it,i found that i have to use

$word = new COM("word.application");

I couldn't found not good examples for reading the msword file by using the COM.

Can any one help me to fix this issues.

Thanks
DeFacto
Forum Commoner
Posts: 37
Joined: Wed Apr 23, 2008 2:30 pm

Re: Read the MSword file form PHP and display in browser

Post by DeFacto »

Hi raveendran,

ive been looking for that as well, but all i could find that it is not possible, because of coding issuses.
Post Reply