tags:

views:

105

answers:

4

Hi all,

For example, i am uploading a word file with some FORMATTED contents in the database. The content in the word document is aligned.

I done up to the above level . My issue is how can i able to view the CONTENTS AS IT LOOKS EXACTLY (means the exact formatted contents) IN A BROWSER.

Kindly help me out of this issue.

Thanks in Advance

Fero

A: 

You may stream the content in the body of the request as an attachment setting the correct MIME Type. If the user's client is configured to handle the content type it will show (after asking for permissions). PHP MIME Content Type

Manrico Corazzi
A: 

Word is a format for word processing, whereas the browser is a client for displaying web pages. So no, you can't. There are some similarities between the two formats, so you can transform between them, but usually at a loss. Since Word is a proprietary format, transforming it to html can be tricky, but you can generally use open office for the job.

troelskn
A: 

Another alternative is, instead of uploading the file, upload the content of the file through the use of a javascript WYSIWYG editor like TinyMCE. Since you will be storing the HTML markups that the editor converts from the formatted contents that you copy-paste in it, it will be very straight-forward to display the contents.

Lukman
A: 

If the content doesn't need to be edited, why not convert it to a .PDF/.JPG on the fly, or do it once upon upload and cache the result?

Shane