Jump to content

[SOLVED] MS documents with fopen and fread


alejandro52

Recommended Posts

When i try to open and display ms documents in my web page all i get is

mHsHhi?i??CJaJmH sH hi?i??CJaJmHsHhi??CJaJmHsHhi?aJmHsH"(VX?Ĉ?$ & F H ? ? 46?????瀀瀀׀瀀瀀?????ˀ?ˀˀˀˀˀˀˀ? $?Ђ`?Ђa$gdi?$???Ђ^???Ђa$gdi?$??Ђ^?`?Ђa$gdi?$a$gdǯ̀??ă? ?????? ?? ?????? ă?

.Does any one know what is the problem?

Link to comment
https://forums.phpfreaks.com/topic/64265-solved-ms-documents-with-fopen-and-fread/
Share on other sites

I have some ms documents that i want to upload to my web page as news.What is the best way to do that?do i have to format them in txt?I'm currently doing this(doc to txt) but the problem is that the text format(paragraphs and such) disappear and the only way i can see to add them back is by adding html tags in the text files.Is there an easier way? COM Seems a bit comfusing and only works in windows php.

Word documents would have the same problem as txt (even if you got all that weird formatting out.) The problem is that the browser has its very own syntax for formatting and the only way to get a new line is with a tag. One thing you can do is, when you read the file into a buffer, you can simply replace all occurances of "\n" with "<br>" and whatever other formatting tags you need.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.