httphandler for a specific folder

  • Thread starter Thread starter Ned White
  • Start date Start date
N

Ned White

Hi All,
I would like to create a httphandler to set text watermark on image files
before it gets displayed to the user.
But this handler must listen specific folder or virtual directory(on same
IIS) not all the image files in the web application, for example it should
work for only "/Images/Products" folder and all its subfolders. Or
"Products" virtual directory and all subfolders.

Is there a way to do this ?

Thanks in advance for suggestions.

Ned
 
httpHandler section in web.config could help.
It has a path property, which could be used to specify handler for
specific path.

I am just guessing it based on the docs.
Experts can help.

Kalpesh
 
You can have a specific web.config for each virtual folder. web.config
inherits settings from parent web.config.

Hope this helps.
 
Problem is that images do not go through .NET thus your handler will not be
called if browser requests /Images/Products/myimaje.jpg

The best way is to have it in your html like
<img src="myhandler.asmx?image=myimage.jpg">
And handler will get the image, sign it and return to the user.



George.
 
Back
Top