views:

39

answers:

1

I have a httphandler that is fitred for all .png files. I would to be able to rewite the name of the file into the html. Is this possible? So if test.png comes into the handler I want to write test.png?V=1

So far I have found the following:

context.Response.AddHeader("content-disposition", "inline; filename=" + context.Request.FilePath + "?V=1");
A: 

Yes it's possible, although I haven't done it.

You should be able to load the imgaes into memory, and serve them from there; during this process you should be able to give the file any name you like.

This will be helpful: http://stackoverflow.com/questions/994135/image-from-httphandler-wont-cache-in-browser

This page has some info on serving images via an HttpHandler (about 2/3rds into the article): http://msdn.microsoft.com/en-us/library/ms972953.aspx

Adrian K