如果我尝试将大文件上传到亚马逊,我会收到以下错误:
“在写入所有字节之前无法关闭流”
这是代码:
amazonClient = AWSClientFactory.CreateAmazonS3Client(_accessKey, _secretKey);
fileTransferUtility = new TransferUtility(amazonClient);
uploadRequest = new TransferUtilityUploadRequest()
.WithTimeout((60 * 60 * 1000) * 2)
.WithBucketName(containerName)
.WithKey(fileName)
.WithInputStream(dataStream) as TransferUtilityUploadRequest;
fileTransferUtility.Upload(uploadRequest);
解决方案是什么?