Jump to content

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.

In short, yes!

 

You could open the document, read in the contents and then try and format it, but by the time you've learned about COM objects and written the PHP you'd have been quicker to do it manually.

 

Regards

Huggie

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.