任何嵌入式文档查看器
我希望在我的 CakePHP 应用程序中包含一个文档查看器,用于上传文档。我想要一个支持 Microsoft Word(.DOC 和 .DOCX)、Microsoft PowerPoint(.PPT 和 .PPTX)和 Adobe 便携式文档格式 (.PDF) 的查看器。
我希望我的用户能够查看文档,但不能下载。 Google 文档查看器很棒,但用户只需将 URL 插入地址栏即可下载文档。
我是否可以像可读文档一样与用户共享我的文档?
I am looking to include a document viewer in my CakePHP application for uploaded docs. I want a viewer that supports Microsoft Word (.DOC and .DOCX), Microsoft PowerPoint (.PPT and .PPTX) and Adobe Portable Document Format (.PDF).
I want my users to be able to view the documents, but not download it. Google document viewer is great, but users can just plug the URL into the address bar and download the document.
Is there anyway I can share my docs with users just as readable docs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,您必须了解,当用户的浏览器显示某些文件/内容时,它已经在用户的计算机上。它已经被下载了。 “内容保留在服务器上,但用户可以看到它”并不存在魔法。数据总是从服务器传输到用户,并且用户可以以一种或另一种方式将数据保留在他的机器上。
如果您理解这一点,您有多种选择:
存在现有的解决方案,即嵌入禁用下载选项的幻灯片共享演示文稿。不要尝试发明自己的东西,尤其是如果您不想在支持和持续增强方面走得更远的话。
First you must understand that when the user's browser displays some file/content, it is already on the user's machine. It has been downloaded already. There is no magic "the content stays on the server, but the user can see it". Data are always transferred from the server to the user, and the user can make the data stay on his machine - one way or another.
If you understood this, you have several options:
There are existing solutions, i.e. embedding slideshare presentations with disabled download option. Don't try to invent your own, especially not if you don't want to go the long way with support and continuous enhancements.
我使用谷歌文档查看器遵循以下指南。
这仍然不是一种非常安全的方法,但对我来说很有效。
I stick with the following guidelines using google document viewer.
This is still not a very secure way but does the trick for me.