AWS S3:TransferUtility在asp.net中不包含UploadAsync的定义

时间:2019-06-05 12:29:00

标签: c# asp.net amazon-s3 awss3transferutility

使用以下代码获取错误

  

TransferUtility不包含UploadAsync的定义


TransferUtility fileTransferUtility = new TransferUtility(s3Client);

TransferUtilityUploadRequest uploadRequest = new TransferUtilityUploadRequest
{
    BucketName = "bucketname",
    FilePath = "foldername",
    Key = "filename",
    InputStream = "file input Stream"
};

uploadRequest.UploadProgressEvent +=
    new EventHandler<UploadProgressArgs>(uploadRequest_UploadPartProgressEvent);

await fileTransferUtility.UploadAsync(uploadRequest);

1 个答案:

答案 0 :(得分:0)

最后我得到了解决方案,我使用的是3.3.102.9版的AWSSDK.S3和4.0版的.Net。

要使用UploadAsync(),需要3.3.102.11版本的AWSSDK.S3,并且需要.Net 4.5或更高版本。