3 回答

TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊
該錯(cuò)誤推斷其存在憑據(jù)問(wèn)題,或者您可能沒(méi)有指定密鑰名稱(chēng) - 通常密鑰名稱(chēng)只是文件名:
string keyName="file.txt";
string bucketName="mybucket";
string directoryFile="C:\\MyDownloadFile";
TransferUtility utility=new TransferUtility(client);
fileTransferUtility.Download(directoryPath,bucketName,keyName);

TA貢獻(xiàn)1871條經(jīng)驗(yàn) 獲得超13個(gè)贊
檢查憑據(jù)和密鑰名稱(chēng),因?yàn)檫@些值無(wú)效可能會(huì)導(dǎo)致您看到錯(cuò)誤。

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超7個(gè)贊
檢查您的目錄和文件名。桌面和服務(wù)器上的目錄不同。
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 關(guān)注
- 221 瀏覽
添加回答
舉報(bào)