I have an MVC 4 controller method returning a FileContentResult as follows:
[OutputCache(CacheProfile = "ImageCache")]
public FileContentResult GetImage(string dl)
{
return File(photoSig.BinaryPhoto, "image/jpeg", "photo.jpg");
}
The ImageCache is defined as follows:
<caching>
<outputCacheSettings>
<outputCacheProfiles>
<add name="ImageCache" duration="1" varyByParam="*" location="Server" enabled="true" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Everything works fine except in IE, when the user does a Save picture as..., it only gives them the option to save as PNG or BMP. Why wouldn't it by a jpg? Chrome and FF give the jpg option as it should.
Another interesting point is that it works fine on my local box but not when deployed...which makes me think it could be a configuration issue. But I don't know where to start looking. The IIS MIME type for jpg is defined on the UI server.