Added a function for MIME type detection based on file extensions.