为什么图像充当下载? [英] Why are image acting as downloads?

查看:45
本文介绍了为什么图像充当下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#ASP.NET.我生成用户友好的图像名称,并使用重写来找到正确的图像名称.通常在Firefox中,当我右键单击图像并单击查看图像时,我会在浏览器中获得该图像.但是这些图像的行为就像下载一样,为什么?

I am using C# ASP.NET. I generate user friendly image names and use rewrite to find the correct image name. Normally in firefox when i right click an image and hit view image i get the image in my browser. However these images are acting like downloads, why?

global.asax:
    void Application_BeginRequest(Object sender, EventArgs e)
    {
        lazy(Context, HttpContext.Current.Request);
    }
file.cs:
    void lazy(...)
    {
        ...
        context.RewritePath(sz);
        //sz = "/user/username/type/image.png"
    }

推荐答案

就像是因为正确的 MIME 类型不随图像一起发送.

Likely because the correct MIME type is not being sent along with the image.

这篇关于为什么图像充当下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆