Fix a bug at uploading files