better check of mime types when uploading files via ajax