Multiple image handler calls causing IE to hang in pop-up window

[亡魂溺海] 提交于 2019-12-05 11:23:55

Have you tried wrapping a using around returnImage to "ensure" that .dispose() is called?

Response.Clear();
Response.ContentType = "image/jpeg";
using (System.Drawing.Image returnImage = System.Drawing.Image.FromFile(completeImageFilePath))
{
    using (MemoryStream stream = new MemoryStream())
    {
        returnImage.Save(stream, ImageFormat.Jpeg);
        stream.WriteTo(Response.OutputStream);
    }
}
if (Response.IsClientConnected)
{
    Response.Flush();
}
Response.End();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!