AWS-SDK-CPP:传输管理器文件下载崩溃

时间:2017-06-23 15:14:24

标签: amazon-s3 awss3transfermanager aws-sdk-cpp

以下使用C ++编写的Visual Studio 2015代码崩溃。我正在v 1.1.1使用AWSSDKCPP-TrasnferNuGet。我在网上找不到任何示例代码或使用C ++ SDK使用传输管理器的适当文档。如果我有错误,请指出。

// download a single file from aws s3 bucket
// use transfer manager
// assume Aws::InitAPI() has already been called
int downloadFile(const Aws::String &bucketName, const Aws::String &objectKey) {

    auto s3Client = Aws::MakeShared<Aws::S3::S3Client>(S3_CLIENT_TAG);
    TransferManagerConfiguration transferConfig;
    transferConfig.s3Client = s3Client;

    // lambda for download progress callback
    transferConfig.downloadProgressCallback =
        [](const TransferManager*, const TransferHandle& handle)
    { std::cout << handle.IsMultipart() << std::endl; };

    // the fabled transfer manager
    TransferManager transferManager(transferConfig);
    auto transferHandle = transferManager.DownloadFile(bucketName, "sample.txt", "sample.txt");
    transferHandle->WaitUntilFinished();    // block calling thread until download complete
    return 0;
}

1 个答案:

答案 0 :(得分:0)

不,你没有错。这是issue #574。修复工作正在进行中。应该很快就会发布。