I'm using ASP.NET Core MVC. I need a data annotation/custom data annotation for IFormFile, that check the file selected/uploaded is an Image, the extension of the image has to match *.png, *.jpg or *.jpeg . This is the view model
public class ProductViewModel
{
[Display(Name = "Image")]
[Required(ErrorMessage = "Pick an Image")]
//[CheckIfItsAnImage(ErrorMessage = "The file selected/uploaded is not an image")]
public IFormFile File { get; set; }
}