3 回答
TA贡献1850条经验 获得超11个赞
该错误推断其存在凭据问题,或者您可能没有指定密钥名称 - 通常密钥名称只是文件名:
string keyName="file.txt";
string bucketName="mybucket";
string directoryFile="C:\\MyDownloadFile";
TransferUtility utility=new TransferUtility(client);
fileTransferUtility.Download(directoryPath,bucketName,keyName);
TA贡献1796条经验 获得超7个赞
检查您的目录和文件名。桌面和服务器上的目录不同。
string accessKey="my access key";
string secretKey="my secret key";
string bucketName="my bucket name";
string directoryFile=@"C:\MyDownloadFile"; //Please check your directory access
TransferUtility fileTransferUtility =
new TransferUtility(
new AmazonS3Client("ACCESS-KEY-ID", "SECRET-ACCESS-KEY", Amazon.RegionEndpoint.CACentral1));
// Note the 'fileName' is the 'key' of the object in S3 (which is usually just the file name)
fileTransferUtility.Download(filePath, "my-bucket-name", fileName); // check file name as your keyName
- 3 回答
- 0 关注
- 86 浏览
添加回答
举报