0

Hi, i have successfully stored a link to docx and pdf files into mysql db. I'm trying to retrieve it from db and display it similar to pictures. Now when the user click on it, it should open the file and display it.

If any one have a code sinppet that can do that or something similar, pls help. Thank you...

4
Contributors
5
Replies
23
Views
3 Years
Discussion Span
Last Post by diafol
1

Would it work if you would just retrieve the links to the files from you DB, then check what file type it is, and then display an icon for that file type instead of a preview of the file? For example for a .doc file you display a Microsoft Word icon with the file name next to it, and then when the user clicks it he is prompted with a "download file" window.

0

Alternatively, have one standard.. PDF (which is compatible through many operating systems) thus providing that all documents can be open in the web browser.

1

Most files like Word documents will get downloaded when you click their links. There are some online viewers though, but they aren't always accurate in what they display, e.g. Dropbox's viewer - there are certain elements that don't quite look like they should. So, IMO, best to leave files of that type as 'downloads'.

0
minitauros and diafol, do u have a sample code? Am having trouble with what i have.
0

Sample code for what? I suggest not using viewers, just provide links to those files and they'll download.

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.