禁用从html页面下载图像 [英] disable downloading of image from a html page

查看:105
本文介绍了禁用从html页面下载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设有一个包含一些图像的html页面。

Suppose there is a html page containing some images.

我们要禁止从用户端下载图像。

we want to disable the downloading of the images from user side.

可能吗?

我需要使用任何 javascript 或在< img> 标记中添加一些属性

Should I need to use any javascript or add some attributes in <img> tag?

我当前的代码是

My current code is

       <td><img src="images/handmade (1).jpg" class="img-responsive" alt="" /></td>

    </tr>
  </table>

有什么技术可以防止图像下载?

Is there any technique to prevent image from downloading?

推荐答案

否,无法完成。此处的说明: https://graphicdesign.stackexchange.com/a/39464/24086

No, it cannot be done. Explanation here: https://graphicdesign.stackexchange.com/a/39464/24086


对于所有意图和目的,这是绝对不可能的。
您可以禁用右键单击,但是人们仍然可以查看页面的源代码(通过将view-source:添加到Chrome中的URL,或仅使用浏览器菜单)并找到URL。
您可以使用CSS背景图片代替HTML,但是人们仍然可以使用其浏览器的检查器(大多数浏览器为F12)并找到该元素的CSS属性。
您可以设计一些您认为可以使用的疯狂工具,但最终,用户必须以某种方式下载图像才能看到它。如果用户完全无法下载图片,那么他/她甚至根本无法看到图片!无论您做什么,都无法阻止浏览网络流量监视器或您喜欢的浏览器开发人员工具的网络标签。

For all intents and purposes, this is downright impossible. You can disable right click, but people can still view the source code of your page (by adding view-source: to the URL in Chrome, or just using a browser menu) and find the URL. You can use a CSS background-image instead of HTML , but people can still use their browser's inspector (F12 for most browsers) and find that element's CSS properties. You can engineer some crazy thing that you think will work, but at the end of the day, the user has to download the image in some way to see it. If the user is completely unable to download the image, he/she won't even be able to see it in the first place! No matter what you do, nothing will prevent a simple glance at a network traffic monitor or the "Network" tab of your favorite browser's developer tools.

这篇关于禁用从html页面下载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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