Preventing Image Bandwidth Theft

M

Med

Hi,

Is there a way to detect in asp.net if images are hot-linked from another
websites? I intend to create a default image and serve that image instead of
the image requested from another website?


Kind Regards

Med
 
T

Tim Van Wassenhove

Med schreef:
Hi,

Is there a way to detect in asp.net if images are hot-linked from another
websites? I intend to create a default image and serve that image instead of
the image requested from another website?

I can think of following techniques (but they're not 100% reliable)

- Check if a HTTP_REFERER header exists, and if it's value is an URL in
your website.

- Check if a cookie is present (the cookie should be generated on all
the pages in your website).
 
H

Henning Krause [MVP - Exchange]

Hello,

the problem here is that the image mime types are handled directly by IIS in
the default configuration. So you'll have to map the image mime types to the
ASP.NET engine, write a custom IHttpHandler class for those file types and
register it in the web.config.

Best regards,
Henning Krause
 
M

Med

It depends on what you mean by "hot-linked".

"Hot-Link" usually refers to the a URL embeded in the html to read a
file/image from another source/website instead of local file/image on the
web server's Folder. (i.e. <img
src="http://www.otherpeopleswebsite.com/images/cat.jpg"> instead of <img
src="images/cat.jpg">)

Thank you all for the suggestions. I think the http_referrer is the easier
option, however writing a custom IHttpHandler seems interesting too.


Regards

Med
 
S

Scott M.

Ok, haven't heard that one. I usually just hear folks talk about "external
links".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top