![]() |
|
|
#1 (permalink) |
|
SJG Photography
Join Date: Mar 2006
Location: South East - UK
Posts: 5
|
Blocking Hotlinking
I'm rebuilding my photography website and will be storing many more photographs on there in the future. I would like to prevent hotlinking of these images as this will eat into my bandwidth allocation.
Does anyone know an easy way to do this? Regards, Steve
__________________
http://www.sjgphotography.co.uk Last edited by SGordon; 26-06-2007 at 10:50 AM. |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Apr 2003
Posts: 106
|
you will need to write a script which will check who the referrer is and respond accordingly. if it is your site then issue the image - if not then just ignore the request
i work in .asp and the variable is Request.ServerVariables("HTTP_REFERER") to send the image to the client then use Response.ContentType = "image/jpeg" Set oStream = Server.CreateObject("ADODB.Stream") Response.BinaryWrite oStream.LoadFromFile("d:\domains\yourdomain.com\ww wroot\pathtoimage\image.jpg").Read oStream.Close Set oStream = Nothing hope this helps dotnet version here http://support.microsoft.com/kb/306654
__________________
old dog - anxious to learn new tricks Last edited by fbridge; 04-07-2007 at 11:51 PM. Reason: added more code |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|