How does Flickr prevent people from downloading images from the site?

后端 未结 2 1299
醉酒成梦
醉酒成梦 2021-02-04 10:53

Just wondering how does Flickr prevent people from downloading images from its site? What are they using?

相关标签:
2条回答
  • 2021-02-04 11:05

    Not to thread dump, but conceptually if you are really trying to lock out downloading an image, you could (i think). Using a framework like asp.net mvc, you could tag the image with a unique key, storing the key either in memory or some other form of persistence and pass it down to the client with the id as the filename. On the returning end, upon request for the file, you could intercept the request for the image and perform a lookup on the key matching it to the actual file. Once you have the file, you return the image as a custom result with the appropriate meta tags (at least in mvc, not sure how you'd do it elsewhere). Before you return it though, you flag the result as being viewed.

    It would be a great deal of work on the server, but it would require a great deal of effort for anyone to snag the image if you utilized Flickr's transparent gif technique in conjunction with it.

    The idea being that a single request would be issued on a normal view and any further attempts to view the image directly (by viewing source and grabbing the url) would be blocked.

    <./threadump>

    Sorry, just had the idea and wanted to add it to the already answered question (sleep deprevation and all that jazz).

    0 讨论(0)
  • 2021-02-04 11:18

    Transparent .gif over the image. You can still download the actual image by viewing the HTML source and finding the image's actual URL.

    For example, a random image: http://www.flickr.com/photos/34285128@N00/4300352607/

    <img style="position:absolute;top:0px;left:0px;display:block" src="http://l.yimg.com/g/images/spaceball.gif" alt="" width="500" height="366">
    

    That's the transparent image on top.

    <img src="http://farm5.static.flickr.com/4057/4300352607_edcc5a4a9e.jpg" alt="Say It With Flowers by *sido* (back in a few days)." title="" width="500" height="366" class="reflect">
    

    That's the actual image, which is displayed below spaceball.gif.

    0 讨论(0)
提交回复
热议问题