开发者

How do I rewrite a file name into the browser using a httphandler - is it possible?

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开发者_如何学JAVA");


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: Image from HttpHandler won't 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜