I have this code
public bool IsImage(HttpPostedFileBase file)
{
var contentType = file.ContentType.Split("/")(0).ToLower() == "image"
if (contentType != "image")
{
return false;
}
return true;
}
however if the user rename an .exe
file to .jpg
, it will still think it is a valid image file. How to prevent this?