亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在c#中使用亞馬遜S3?

如何在c#中使用亞馬遜S3?

PHP
慕慕森 2024-01-20 16:08:09
我想使用 amazon s3 下載文件。我有存儲桶名稱、秘密和訪問密鑰。什么是區域端點以及如何設置它我可以使用我擁有的這些信息下載文件嗎string accessKey="access key";string secretKey="secret key";string bucketName="my bucket name";string directoryFile="File directory";TransferUtility utility=new TransferUtility(client); //download.   --But this line error.Error is:The request we calculated does not match the signature you provided.Check your key and signing method.
查看完整描述

3 回答

?
慕蓋茨4494581

TA貢獻1850條經驗 獲得超11個贊

該錯誤推斷其存在憑據問題,或者您可能沒有指定密鑰名稱 - 通常密鑰名稱只是文件名:


string keyName="file.txt";

string bucketName="mybucket";

string directoryFile="C:\\MyDownloadFile";


TransferUtility utility=new TransferUtility(client);

fileTransferUtility.Download(directoryPath,bucketName,keyName); 


查看完整回答
反對 回復 2024-01-20
?
慕桂英4014372

TA貢獻1871條經驗 獲得超13個贊

檢查憑據和密鑰名稱,因為這些值無效可能會導致您看到錯誤。



查看完整回答
反對 回復 2024-01-20
?
蕪湖不蕪

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



查看完整回答
反對 回復 2024-01-20
  • 3 回答
  • 0 關注
  • 198 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號