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 關注
- 198 瀏覽
添加回答
舉報