use mimetypes to figure out if a file is allowed or not