views:

48

answers:

1

how website check the file uploaded by user is image or not. i want to do this in asp.net mvc c#

+4  A: 

pass the file contents into a Bitmap object (using the ctor with Stream parameter), and if the constructor throws an ArgumentException, it's not an image (for popular image formats, mind you).

Shachar