I’m hosting images on a server, within an ASP.NET application.
I wrote a custom http handler that resizes the image and also increment “image_view_count” in a DB.
Now, I would like to also do some logging to know where the image is used. For example:
Image abc.jpg is on my server at http://www.myserver.com/stuff/abc.jpg
Somebody uses it by linking it in a forum post located at http://www.forum.com/thread.php?id=1234
I would like to retrieve the http://www.forum.com/thread.php?id=1234 URL in my http handler. When I use Request.Url.ToString(), in the previous example, I receive http://www.myserver.com/stuff/abc.jpg.
How should I do this ? Is there an equivalent in managed code to location.href ?
I believe you’re looking for the
Refererheader.