开发者

How to display documents from folder?

How can i display word documents, pdf documents in the brow开发者_StackOverflow社区ser using files from the web folder? So if a user uploads a pdf report and wants to see it in the browser, how can i allow that to happen? Can HTML5 be of use?


From your comment about displaying images, it seems like what you want is to embed the PDF or Word file in the page. The easiest thing to do is use an iframe, like so:

<iframe src="http://myserver.com/userUploads/foobar.doc" width="500px" height="500px">
</iframe>

However, the different widgets for different document types will look substantially different and may not provide all the functionality you would expect (as in this example). In addition, not all browsers will be configured with a way to display the document inline - some will prompt the user to download the file.

Uploading the documents to something like Scribd will provide a more uniform experience across document types and browsers; however, depending on how important it is for these documents to be private, Scribd may not be a good solution.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜