0

I am designing a website, and one of the features I would like to have is that certain users can upload documents to their account (my file system). ".doc" files, ".pages" files, etc. may be uploaded as of now (although, nothing is set in stone). Users should be able to preview these on the site, and just to clarify, I don't want editing, only previewing. Considering it's not possible to display a raw ".doc" file in a browser, how can I get an image (png would be best) of the document to display as a preview? Is there any way to use something like <img src="ambiguous_src"></img> where ambiguous_src is the uploaded document?

I have a feeling there isn't any easy way to do this. Maybe convert the document into a pdf and then...I'm really not sure...

Thank you for your help!

John Zimmerman
  • 163
  • 2
  • 7

1 Answers1

0

There's no complex solution so you need to write a separate "handler" for each file type that will generate the preview.

For .doc you can find solution here.

Community
  • 1
  • 1
Vyktor
  • 20,559
  • 6
  • 64
  • 96