-2

Is there a way to force an asp page to load whenever an image file is requested on its own?

What I would like to do is not just show the image when someone clicks through from a Google image search but load a page with code to allow me to provide further information around that image.

chopper
  • 6,649
  • 7
  • 36
  • 53
  • So, the perpetual question: What have *you* tried? – Paul Oct 14 '14 at 07:52
  • I haven't tried anything as I have no idea how or if it can be done. Obviously if an asp page is loaded I can do it but if it is just the image that is viewed (via a "View Image" on Google Images) I would like it redirected to a page where I can wrap the image with code. – Chris Young Oct 16 '14 at 06:48
  • So I would recommend a bit of research in the first instance. You could possibly start by looking at [this](http://stackoverflow.com/questions/2286327/asp-how-to-get-url-of-referring-site), if you're looking at Classic ASP (as per your tag) or [this](http://stackoverflow.com/questions/803027/finding-the-referring-url-that-brought-a-user-to-my-site) if you're talking about ASP.NET. – Paul Oct 16 '14 at 09:08
  • ty. I spent a lot of time researching with no luck. Sorry if I haven't made my requirement clear, I will try to elaborate. The post you referred me to talks about getting the "referer" which I know how to do. It isn't really an asp question as the request to load the image will go straight to the server rather than to an asp page. I am trying to determine whether it is possible to intercept the image request and say that if the image has been loaded via a visit from an external site then redirect it to an asp page passing in the image name so I can wrap it in code. Hope that makes sense? – Chris Young Oct 17 '14 at 10:18

1 Answers1

0

I did find this, though this isn't really what you're looking for.

I also found this about ISAPI filters that can be applied to IIS, though you'd need to write this as a library (DLL) and, to be honest, I know less than nothing about this.

It's probably not much of a help to you, I'm afraid.

Paul
  • 4,160
  • 3
  • 30
  • 56