Using C# how can I test a file is a jpeg? Should I check for a .jpg extension?
Thanks
You could try loading the file into an Image and then check the format
Image img = Image.FromFile(filePath); bool isBitmap = img.RawFormat.Equals(ImageFormat.Jpeg);
Alternatively you could open the file and check the header to get the type