Posted by dkruger on 08/09/07 13:39
On Aug 9, 8:03 am, piyush <piyush.pla...@gmail.com> wrote:
> i have to show the contents of a word document
> i tried readfile() but that shows many binary characters of word
> document which looks odd
> plz suggest me any idea to show content of a word document just as
> Google Docs & Spreadsheets shows after uploading a word document on
> the fly.
>
> plz help me its urgent suggest any way
What you need to be sure to do in your script that reads the file is
set the headers so the browser will know what it is supposed to be
doing with the file, instead of displaying as plain text. If you add
the headers like:
header("Content-type: applicaton/msword");
It will probably work like you are wanting it to, to get the word
document to display in the web browser. The header has to be sent
prior to sending any other data output in the script. Hope it helps.
Thanks,
David
[Back to original message]
|