views:

1367

answers:

13

it is possible ? what is the best way to do this ?

+26  A: 

No, it's not possible.

If you can see it, you can get it.

Josh Leitzel
+1. You can make it inconvenient, you can make it hard, but you can't make it impossible.
JMP
The images/video have to be downloaded to the browser for the user to see them. They'll be somewhere on they're computer.
Edd
If you stream the video instead of hosting the file, you can make it a bit more difficult for users to leech them.
Chris Ballance
If you can see it you *already got it*
annakata
+1  A: 

No it's not. You may block right-clicks and simillar stuff but if someone wants to download it, he will do so, trust me ;)

Philipe Fatio
Right-click blocks are horribly annoying I want to right-click a link and choose "Open Link in new Tab", for example.
vit
Right-click blocks are easily circumvented by simply turning off JavaScript in your browser temporarily. Also, I have to agree wit' vit: they really are horribly annoying.
Dubs
+1  A: 

As soon as they view your page that includes the picture or video, the item is downloaded into the temporary folder of their browser. So if you don't want it downloaded, don't post it.

Jeff Siver
+4  A: 

Don't post them to your site.

Otherwise it is not possible.

Chris Ballance
+1  A: 

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

+4  A: 

In short, no. If someone can view an image or video in their browser then they have, by definition, downloaded it. That's how the web works - it is client server based. Whatever you can view in your browser (client) has been transfered to your computer from the remote website (server).

Dan Diplo
and it's this creation of a "copy" every time someone views your website that goes a long way towards creating the mess that is copyright law on the internet
rmeador
+5  A: 

Images must be downloaded in order to be viewed by the client. Videos are a similar case, in many scenarios. You can setup proxy scripts to serve the files out, but that doesn't really solve the issue of preventing the user from getting their own copy. For a more thorough discussion of this topic, see the question How can I prevent/make it hard to download my flash video?

Jonathan Sampson
+1  A: 

You can mark folders or files so that they don't have read access (any of the main web servers support 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 web account for FTP access, but don't want anyone to view the files. (i.e. upload a .bak file to the server for someone else to FTP down again).

However, as others have said, getting into copyright areas where people can view the image or video but not save them locally is not fully possibly, although there are tools to discourage illegal usage.

Scott Forsyth
+4  A: 

In standard HTML, I don't know of anyway.

You didn't really say, but I'm guessing you are having problems with people deep linking into your content. If that's the case, and you are open to server side code, I believe this might work:

  1. Create a page that accepts a numeric id, maps it to a server file path, opens that file, writes the binary directly to the response stream.
  2. On the page request, generate a bunch of random ids, and map them to the actual media urls, and store that mapping object server side somewhere (in session?) with a limited life.
  3. Render your pages with your media links pointing to the new media page with the appropriate id as a query string argument.
  4. Clear the mapping object and generate all new links on every postback.

This :

  1. won't stop people from downloading from within your page
  2. definitely isn't as lightweight as standard HTML
  3. and has it's own set of issues.

But it's a general outline of a workable process which might help you prevent users from deep linking.

John MacIntyre
+2  A: 

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

But you can make it harder.

You can overlay images with a transparent div, which will prevent people from right clicking on them (or, setting the background of a div to the image will have the same effect).

If you're worried about cross-linking (ie, other people linking to your images, you can check the HTTP referrer and redirect requests which come from a domain which isn't yours to "something else".

David Wolever
+4  A: 

I'd like to add a more philosophical comment. The whole intent of the internet, particularly the World Wide Web, is to share data. If you don't want people to download a picture/video/document, don't put it on the web. It's really that simple. Too many people think they can impose their own rules on an existing design. Those who want to post content on the web, and control its distribution, are looking to have their cake and eat it too.

A. L. Flanagan
+1  A: 

It also doesn't hurt to watermark your images with Photoshop or even in Lightroom 3 now. Make sure the watermark is clear and in a conspicuous place on your image. That way if it's downloaded, at least you get the advertising!

Jordan
A: 

Put your image or video in flash format. Works great.

Ferrari
Is there a tool that runs on linux server that converts mp3 to swf?
Pons
Three words: Flash Decompiler Trillix. Also works great.
Fordi