我可以选择哪些选项来防止图像/视频的异地链接
在工作中,我正在构建一个用于上传用户视频的表单,他们希望包含一个选项,您可以在其中指定是否允许您的视频嵌入到另一个网站上。有没有办法防止视频/图像被其他网站查看和下载?
我见过当图像托管在某个地方并且该帐户只分配了这么多带宽时,就会发生这种情况。
我什至不知道如何标记这个。
At work I am building a form for uploading a user video and they want to include an option where you can specify if you want to allow your video to be embedded on another web site. Is there a way to prevent the video/image from being viewed and downloaded from another web site?
I've seen it happen with images when they are hosted somewhere and the account only has so much bandwidth allocated to it.
I don't even know how to tag this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,你可以。这取决于您想要限制访问的级别。如果您只想限制来自其他网站的嵌入(但不介意其他人无论如何都可以下载视频),解决方案可以是观看引用标头。
像这样的伪代码:
干杯!
Yes you can. It depends at what level you want to limit the access. If all you want is to limit embedding from other websites (but don't mind that others can download the video anyway) a solution can be to watch the referer header.
Something like this pseudo-code:
Cheers!
在 WordPress 网站上面临相同的要求,并设法使用
htaccess
指令来做到这一点:Faced the same requirement on a Wordpress website and managed to do it using
htaccess
instructions: