设置 Handler.ashx 的扩展名
我有一个通用处理程序 Image.ashx
通过从查询字符串中读取信息(如 Image.ashx?filename=foo.jpg&maxwidth=200&maxheight=300)来动态裁剪/调整图像大小
。
有没有办法可以将此处理程序的扩展名更改为 .jpg
? (它总是返回 jpg)我希望调用看起来像这样:Image.JPG?filename=foo.jpg&maxwidth=200&maxheight=300
?
I have a generic handler Image.ashx
that crops/resizes images on the fly by reading information from the querystring like Image.ashx?filename=foo.jpg&maxwidth=200&maxheight=300
.
Is there a way that I can change the extension of this handler to .jpg
? (it always returns jpgs) I'd rather the calls look like this: Image.JPG?filename=foo.jpg&maxwidth=200&maxheight=300
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以使用路由基础结构将 image.jpg 指向图像.ashx
Yes, you can use the routing infrastructure to point image.jpg to image.ashx