设置 Handler.ashx 的扩展名

发布于 2025-01-01 01:43:41 字数 294 浏览 4 评论 0原文

我有一个通用处理程序 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

洛阳烟雨空心柳 2025-01-08 01:43:41

是的,您可以使用路由基础结构将 image.jpg 指向图像.ashx

Yes, you can use the routing infrastructure to point image.jpg to image.ashx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文