check authentication when uploading files