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

How to prevent downloading images and video files from my site? Is it possible? What would be the best way to do this?

+35
html image video blocking
Aug 18 '09 at 15:10
source share
23 answers

No, It is Immpossible.

If you can see it, you can get it.

+80
Aug 18 '09 at 15:11
source share

Do not post them on your site.

Otherwise it is not possible.

+15
Aug 18 '09 at 15:13
source share

Images must be uploaded for viewing by the client. In many scenarios, video is a similar case. You can configure proxy scripts to work with files, but in reality this does not solve the problem of preventing the user from getting his own copy. For a more detailed discussion of this topic, see Question How can I prevent / complicate the loading of my flash movie?

+10
Aug 18 '09 at 15:14
source share

I would like to add a more philosophical comment. The whole intent of the Internet, especially the World Wide Web, is to share data. If you do not want people to upload an image / video / document, do not post it on the Internet . It's really that simple. Too many people think they can impose their own rules on existing design. Those who want to post content on the Internet and control its distribution are looking for their cake and eating it too.

+8
Aug 18 '09 at 16:03
source share

In short, no. If someone can view an image or video in their browser, then by definition they download it. How a website works - this is a client server. Everything that you can view in your browser (client) has been transferred to your computer from a remote website (server).

+7
Aug 18 '09 at 15:13
source share

In standard HTML, I donโ€™t know at all.

You really did not say, but I assume that you have problems with people deeply attached to your content . If this is the case, and you are open to the server side code, I believe this might work:

  • Create a page that accepts a numeric id, maps it to the server file, opens this file, writes the binary file directly to the response stream.
  • In the page request, create a bunch of random identifiers and match them with the actual display URLs, and map the server side of the object somewhere (in a session?) With a limited lifetime.
  • Send your pages with your media links pointing to a new multimedia page with the corresponding identifier as a string request.
  • Clear the mapping object and generate all new links with each postback.

It:

  • won't stop people from loading from your page
  • definitely not as light as standard HTML
  • and has its own set of problems.

But this is a general outline of a workable process that can help you avoid deep user binding.

+6
Aug 18 '09 at 15:37
source share

As many have said, you cannot stop anyone from downloading content. You just can't.

But you can make it harder.

You can overlay images using a transparent div , which will prevent people from right-clicking (or if the background div on the image will have the same effect).

If you are concerned about cross-connection (that is, other people linking to your images, you can check the HTTP referrer and redirect requests that come from a domain that does not belong to you "something else".

+5
Aug 18 '09 at 15:46
source share

Since the browser needs to transfer content to display it (text, images, video), the data is already on the client computer when displaying the website. However, since the previous answers say little about how to make it more difficult for the inexperienced used to capture content, here are a few directions:

  • General
    • Overlay respecitve content on transparent <DIV> or transparent image (as described in some answers to this question)
    • Open the website in a frameset, so saving may skip the contents of the frame.
    • Open the website with window.open() to hide the menu bar.
    • Disable right-clicks through JavaScript (not recommended due to all side effects for ease of use).
    • Download the HTML code of the page from another file (which a particular referent can check or which may be ROT13) using JavaScript, so itโ€™s more difficult to access the source code.
    • Tell the browser that the entire contents of display:none for the printer (something like @media print { body, div, p { display: none } } )
    • Use JavaScript to hide the content before the client takes a screenshot (see Stop the user from using "Print Scrn" )
    • Try disabling or overwriting the clipboard (see this post )
  • Images
    • Do not use the <img> for images, but set the image as the background for <DIV>
    • Wrap images in SVG or Flash movies to make them very difficult to access in an easy-to-use format.
    • Disable image caching (using the <meta> or by setting the appropriate header when the server is delivered), so they are not saved in the browser cache (they are available on the client computer on an ongoing basis).
    • Cut the image into parts, so additional work is required to restore the entire image.
    • Add onmousedown events to images, for example, display a copyright warning.
    • Transfer the image through a script server (e.g. PHP) and check the referent.
  • Video
    • Streaming video to prevent simple URL downloads.
    • Wrap the video in a Flash movie.
    • Use some nasty format that supports DRM.
  • Texts
    • Make text non-selectable (see How to make HTML text unselected )
    • In addition to overlaying, wrap the text in JavaScript (for example, after ROT13 or dynamically load it from the second file), so the text is not available directly in the source code.
    • Convert texts to images (this may reduce image quality), SVG or Flash

Again, I repeat that none of this will stop an experienced user from capturing content (for example, by making an adaptation and, if necessary, by running OCR). Sometimes it's as simple as using a browser developer tool or using a website without JavaScript. However, this will give users inexperience a hard time, so they can look more lightly than easier.

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

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

+4
Jan 28 '16 at 9:35
source share

If you use PHP, the best way is to control it .htaccess , you need to place your files, images and videos in a separate folder / directory and create a new .htaccess file in this directory with below:

 RewriteEngine On RewriteCond %{REQUEST_URI} \.(mp4|mp3|avi)$ [NC] RewriteCond %{HTTP_REFERER} !^http://sample.com/.*$ [NC] RewriteRule ^.* - [F,L] 

The first line of %{REQUEST_URI} will not allow you to get the file through a web browser or through curl . The second line, %{HTTP_REFERER} prevent access to imahe / videos using the HTML <img> or <video> tags from any website, except for exceptions ! which you provide instead of http://sample.com/ , which should usually be your website.

You can also see my question and accepted answer here for more tricks in the browser side.

+4
May 13, '17 at 13:50
source share

It also helps to watermark your images using Photoshop or even in Lightroom 3. Make sure the watermark is transparent and in a prominent place in your image. Thus, if it is downloaded, at least you will get ads!

+3
Nov 04 '09 at 21:02
source share

you can reduce the possibility, but not eliminate it ...

+2
Aug 18 '09 at 15:13
source share

This is how I do it if someone in the future asks a question.

I put this in a .htaccess file on the root server:

 RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com/ [NC] RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com.*$ [NC] RewriteRule \.(mp4|avi)$ - [F] 

This stops them from going to domain.com/videos/myVid.mp4 and then saving it there.

+2
Jun 28 '14 at 22:27
source share

No no. You can block the right-clicks and simillar, but if someone wants to download it, he will do it, believe me;)

+1
Aug 18 '09 at 15:12
source share

As soon as they view your page, including an image or video, this item is loaded into the temporary folder of their browser. Therefore, if you do not want it to be downloaded, do not publish it.

+1
Aug 18 '09 at 15:13
source share

You can mark folders or files so that they do not have read access (any of the main web servers supports this). This allows you to store them on the server without any level of access to the outside world. You may want to do this if you have a service that generates images for someone else to download later, or if you use your account to access FTP, but do not want anyone to view files. (for example, upload the .bak file to the server so that someone else on FTP starts up again).

However, as others have said, getting into the copyright field where people can view an image or video but not save them locally is not entirely possible, although there are tools that prevent illegal use.

+1
Aug 18 '09 at 15:27
source share

Place the image or video in flash format. It works great.

+1
Jan 18 '10 at 23:32
source share

This is an old post, but for videos you might want to use MPEG-DASH to obfuscate your files. In addition, it will provide the best streaming experience for your users without the need for a separate streaming server. Additional information in this post: How to disable the download of video / audio on web pages?

+1
May 05 '16 at 10:09
source share

Paste transparent 1px x 1px gif directly into the <body> :

 <body><img src="route-to-images/blim.gif" class="blimover"> 

Then create it like this:

 .blimover { width: 100% !important; height: 100% !important; z-index: 1000 !important; position: absolute !important; top: 0 !important; left: 0 !important; } 

This will remove any click functions from the page, but it will definitely stop people stealing any content!

You can apply the same to <div> , <section> , <article> , etc., just by specifying a name and not copying your copy and / or image.

Nothing stops screengrab though ......

0
Jun 11 2018-12-12T00:
source share

It is provided that any image that a user can see can be saved on a computer, and there is nothing you can do about it. Now, if you want to block access to other images that the user should not see, I actually do it like this:

  • Each link to "src" in your image tag is actually a request to send to the controller on the server,
  • the server checks the access rights of this particular user and returns an image if the user should have access to it,
  • All images are stored in a directory that is not directly accessible from the browser.

Allowance:

  • The user will not have access to anything that you do not intend to have access to

Minus:

  • Those requests are slow .. especially there are many images on one page. I did not find a good way to speed it up really.
0
Sep 09 '13 at 3:44 on
source share

You can set the image to a background image and have a transparent foreground image.

0
Mar 06 '14 at 10:14
source share

You cannot stop stealing an image / video, but you can make it harder for ordinary users, but you cannot make it harder for programmers like us (I mean thieves who know little about web programming).

There are a few tricks you can try:

1.) Using flash like YouTube and many other sites like http://www.funnenjoy.com .

2.) An overlay div or background pic setting (but users with little sense can easily save all resources by opening a check item or another developer option).

3.) You can disable right-click and certain keys, such as CTRL + S, and others with JavaScript, but the main drawback is that if the user disables JavaScript, our tricks will not work.

4.) Save the image in no online directory (if you have full access to the web server) and read these files with server languages โ€‹โ€‹such as PHP, every time you need an image / video and changes the image identifier from time to time or creates a script that can automatically change the identifier after each access.

5.) Use .htaccess in apache to prevent other sites from linking your images. you can use this site to automatically create .htacess http://www.htaccesstools.com/hotlink-protection/

0
Mar 23 '14 at 12:36
source share

If you want only authorized users to receive content, the client and server must use encryption.

For video and audio, a good solution is Azure Media Services, which has content protection and encryption. You insert the Azure media player into your browser and stream the video from Azure.

For documents and email, you can look at Azure Rights Management, which uses a special client. Unfortunately, it does not currently work in regular web browsers, with the exception of one-time, one-time codes.

I donโ€™t know exactly how safe it is. As others have pointed out, from a security point of view, once these downloaded bytes are in the โ€œattacker'sโ€ RAM, they are as good as they are. In this case, the solution will not be 100% safe (please correct me if I am wrong). As with more security, the goal is to make it more difficult, so 99% are not bothered.

0
Oct 18 '17 at 3:42 on
source share

I think the best way: VIDEO FLOW IN SEPARATE ENERGIES.

There are video hosting services like vzaar that have this functionality. As far as I know, it will be very difficult to download directly. At least for 95% of people.

But, of course, if the video plays on the screen, people can simply use the on-screen recorder and some simple software to record sound from the audio output (but he or she will have to play FULLY to save it, itโ€™s completely inconvenient).

-one
Sep 19 '14 at 3:12
source share



All Articles