title: How to validate uploaded file in ASP.NET MVC?
body: <p>I have a Create action that takes an entity object and a HttpPostedFileBase image. The image does not belong to the entity model.</p>
  
  <p>I can save the entity object in the database and the file in disk, but I am not sure how to validate these business rules:</p>
  
  <ul>
  <li>Image is required</li>
  <li>Content type must be "image/png"</li>
  <li>Must not exceed 1MB</li>
  </ul>