954,160 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

convert anyfile to html

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

manojjena1982
Newbie Poster
22 posts since Jan 2009
Reputation Points: 10
Solved Threads: 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?

FlashCreations
Posting Whiz
395 posts since Sep 2008
Reputation Points: 47
Solved Threads: 47
 

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.

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

yes you have to write codes for different type of files in different manner.

BzzBee
Posting Whiz
327 posts since Apr 2009
Reputation Points: 16
Solved Threads: 48
 

Coulld you share any idea to do this?

manojjena1982
Newbie Poster
22 posts since Jan 2009
Reputation Points: 10
Solved Threads: 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:PDF - http://www.pdflib.com/products/
Doc - http://site.n.ml.org/info/catdoc/
Docx - http://wvware.sourceforge.net/

FlashCreations
Posting Whiz
395 posts since Sep 2008
Reputation Points: 47
Solved Threads: 47
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You