I have a somewhat complex edit model coming into (surprise surprise) an Edit ActionMethod. One of the model's properties is a HttpPostedFileBase
object, which I'd like to validate and display the validation results on the form if the file isn't legit. To this end, I've already started work on a custom ValidationAttribute object, based on RequiredAttribute
(see How to validate uploaded file in ASP.NET MVC? for an idea of where I'm going).
Is there anything I can do in addition to checking the file extension and MIME type to ensure that, yes, the file being uploaded is indeed an image?