0

Hi! thr,

I am uploading a file in to server. At the time of downloading, it should show "view as html" as google does.

thanx in advance.

Manoj

4
Contributors
5
Replies
7
Views
8 Years
Discussion Span
Last Post by FlashCreations
0

Google Docs and HTML are two different things. Do you want a link that shows the HTML of a document or do you want a link to view the document in Google Docs?

0

Hi! thr,

I am uploading a file in to server. At the time of downloading, it should show "view as html" as google does.

thanx in advance.

Manoj

This is actually a complicated task. You'll need to be able to parse different file types into HTML.

For example, converting a PDF file to HTML is different from converting a word document.

You'll have to do specific parsing for each file you want to support.

Security is also an issue here. You'll probably need to scan the documents for vulnerabilities.

0

Well what kind of files would you be uploading. Images? Document? Presentations? Some of these are extremely easy to view as html. For most images (except for PSD's and others that won't display in a normal browser) all you have to do is just output a simple HTML document and use the img tag to include the image in it. For non-supported formats of images, you will need to convert them to a more standard format such as PNG or JPG. This can be done simply by Googling for a php PSD to PNG converter. The same goes for any kind of document. You can find PDF to HTML converters, you can find Doc and Docx to HTML converters. All you have to do is search Google for all the file types you would like to support. I've found some of these PHP converters for you:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.