image valid before upload - memory stream

bool IsValidImage(Stream str) { try { using(var image = Image.FromStream(str)) { return true; } } catch(Exception) { return false; } }

Yorumlar