How to protect against direct access to images?

前端 未结 9 1059
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 00:47

I would like to create a web site with many images. But I would like to protect against direct access to images, e.g. direct links to images without visiting the web site.

9条回答
  •  盖世英雄少女心
    2020-12-05 01:36

    This is going to be hard to do. In order for your clients' web browsers to access the pictures, they need to be readable. File permissions won't work because you'll need to grant access to the browser. You won't be able to stop someone from downloading them and doing something with them.

    If you only want to stop direct linking, if you change the filenames on a regular basis and update your pages to reflect this, other pages will have their links broken.

提交回复
热议问题