How to prevent downloading images and video files from my website?

No, it's not possible.

If you can see it, you can get it.


Don't post them to your site.

Otherwise it is not possible.


As the browser needs to transfer the content to display it (text, images, videos), the data is already on the client's computer when the website is displayed. The previous answers give little advice on how to make it harder for non-experienced users to grab the content. Here are some directions:

  • General
    • Overlay the respecitive contents with a transparent <DIV> or a transparent image (as described in some answers to this question)
    • Open the website in a frameset, so saving may miss the frame content.
    • Open the website via window.open() to hide the menu bar.
    • Disable right-clicks via JavaScript (not recommended due to all the side-effects on usability)
    • Load the page's HTML code from another file (which may check for a specific referer or which may be ROT13) via JavaScript, so it's harder to access the source code.
    • Tell the browser that all content is display:none for the printer (something like @media print { body, div, p { display: none } })
    • Use JavaScript to hide the content before a client makes a screenshot (see Stop User from using “Print Scrn”)
    • Try to disable or overwrite the clipboard (see this post)
  • Images
    • Do not use the <img> tag for images but set the image as background for a <DIV>
    • Wrap images into SVGs or Flash movies to make them very hard to access in a usable format.
    • Disable caching for images (via <meta> tag or by setting the appropriate header on server delivery), so they are not stored in the browser cache (immeaditely accessible on the client's computer).
    • Cut an image into parts, so it takes some extra work to reconstruct the whole image
    • Add onmousedown events to images, e.g., display a copyright alert.
    • Deliver the image via server script (e.g., PHP) and check the referer.
  • Videos
    • Stream videos to prevent simple downloading via URL.
    • Wrap videos into a Flash movie.
    • Use some nasty format that supports DRM.
  • Texts
    • Make text unselectable (see How to make HTML Text unselectable)
    • Additionally to overlaying, wrap the text into JavaScript (e.g., after ROT13 or loaded dynamically from a second file), so the text is not directly available in the source code.
    • Convert texts to images (this may decrease display quality), SVGs or Flash

Again, I repeat that none of this will stop an experienced user from grabbing the content (e.g. by making a screenshot and - optionally - run OCR on it). Sometimes it's as easy as using the browser's developer tools or using the website without JavaScript. Yet, it will give inexperiences users a hard time, so they may look for some easier source to grab from.

Also keep in mind that the above techniques will affect search engines when reading the page's content (if you're interested in blocking them, start with a robots.txt).

Thank you for any other ideas to complement the above list!