Could also convert this method to `mime.lookupMimeType(file.name)` - we're already using the mime library elsewhere.