Rather than trust the user-controlled mimetype or extension of imported
files which may be incorrect (because the user is lying, because the
system is misconfigured, because software is not installed, because
software is registering non-standard mimetypes, etc...), start by trying
to guess the mimetype *then* fallback on trying the type/ext.
Of note: CSV is becoming less and less great as it's nigh impossible to
guess for it.