Welcome to WebmasterWorld Guest from 34.239.158.107

Forum Moderators: ocean10000

Message Too Old, No Replies

Hotlinking/Offsite Image Linking ASP.NET Solution

     
5:07 am on May 22, 2003 (gmt 0)

New User

10+ Year Member

joined:Oct 15, 2002
posts:30
votes: 0


In PHP you can use mod_rewrite to check the server headers against the host.

Is there a way to do this in ASP.NET?

Perhaps with the global.asax or web.config?

Is there a way to make sure no one can steal my bandwidth?

Thanks!

10:56 pm on May 23, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jeremy_goodrich is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 4, 2000
posts:3468
votes: 0


2 days, no ideas - I'll see if I can round up an ASP / IIS guru for you (or at least somebody with a solution).
12:15 am on May 24, 2003 (gmt 0)

New User

10+ Year Member

joined:Oct 15, 2002
posts:30
votes: 0


Thanks alot!

:)

6:58 pm on May 24, 2003 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator ianturner is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 19, 2001
posts:3666
votes: 54


It is definitely not as simple as it is with PHP.

The only methods I have devised at the moment are as follows:

1. Write and install an ISAPI filter to parse the incoming requests.

2. Create a temp_images folder. When a page request comes in you set up a timestamped image in the temp_images folder using the FileSystemObject, this can be written into the page based on the incoming SessionID. You can use the FileSystemObject to clear the images out once they have served there useful purpose.

Xoc

2:26 am on May 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 18, 2001
posts:1437
votes: 0


In .net you can create a imaginary file quite easily. Put this into the web.config:


<?xml version="1.0" encoding="utf-8"?>
<configuration>

<system.web>
<httpHandlers>
<add verb="GET,HEAD" path="*.png" type="Namespace.ClassName,ClassName" />
</httpHandlers>
</system.web>

</configuration>

Where Namespace and ClassName are replaced by your namespace and classname. Then create some code that gets called when a png (or whatever) file is called. For example:


Public Class ClassName
Implements IHttpHandler

Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) _
Implements System.Web.IHttpHandler.ProcessRequest

'code here to deliver file

End Sub

httpHandlers are the replacements for ISAPI filters in .NET.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members