如何使我的网页中的图像无法下载 [英] how to make images in my webpages not downloadable

查看:167
本文介绍了如何使我的网页中的图像无法下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何通过在我的网页上右键单击图像来防止人们保存图像。

I am wondering how to prevent people from Save image as.. by right-click images on my webpages.

我正在考虑禁用右键单击,但是似乎我必须编写JavaScript代码。有没有办法做到这一点?

I was thinking about disable right-click, but it seems I have to write javascript code. Is there a easy way to do this?

推荐答案

简单的答案是你不能这样做。您可能可以在服务器端放置某些东西,以便在提供图像之前检查引用者,但即使这不是100%的保证。此外,即使您以某种方式管理这种情况,也不会阻止某人从浏览器页面中截取屏幕截图,然后从中删除图像。

The simple answer is "you cannot do that". You might be able to put something on the server side that will check the referer before serving the image, but even that is not 100% guaranteed. Moreover, even if you did manage somehow to prevent this, nothing would prevent somebody from taking a screenshot of the browser page and then cropping the image out of it.

我认为一个更好的方法是使服务器端url重写和处理图像以添加某种可见的水印来标识您拥有的图像,并在EXIF信息中保存适当的版权信息。

I think a much better approach would be to have a server-side url rewriting and processing of the images to add some sort of a visible watermark identifying the images as owned by you and saving a proper copyright information in the EXIF information.

这篇关于如何使我的网页中的图像无法下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆