Fixed a bug in uploading files