Why to check the extension as last? String manipulations could be faster than file type checks via the external library but what is really important is the readability of the code. This one says "we accept any ISO, or some other types of files". Your version would say "we accept some types of files, or any ISO". ;)