0

In my MVC site, I'm returning image from a database, using the controller action below. This works fine for the most part. The only problem I'm having is that in IE8 and lower, pngs aren't being displayed. They show the red "X" instead. Any ideas?

public ActionResult Image(Guid id)
{
    ContentService svc = new ContentService();

    BinaryContent content = svc.GetBinaryContentById(id, "en-US");

    string mimeType = string.Format("image/{0}", content.BinaryType);
    string fileName = string.Format("{0}.{1}", id.ToString(), content.BinaryType);

    return File(content.Data, mimeType, fileName);
} 
4

0 に答える 0