線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2121
推到 Plurk!
推到 Facebook!

如何連結 Amazon Web Services 下載一個文件檔

尚未結案
chris681016
中階會員


發表:69
回覆:122
積分:98
註冊:2006-10-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2021-12-07 12:02:28 IP:36.227.xxx.xxx 未訂閱
使用 xe2 版 win10系統

procedure TForm1.Button5Click(Sender: TObject);
var
ConAmazon: TAmazonConnectionInfo;
Service: TAmazonStorageService;
Response: TCloudResponseInfo;
Text_Byte: TBytes;
Text_Stream: TStringStream;
bResult : Boolean;

begin
try
Text_Stream:= TStringStream.Create;
ConAmazon := TAmazonConnectionInfo.Create(nil);

ConAmazon.AccountKey :=trim(Edit2.Text);
ConAmazon.AccountName := trim(Edit1.Text);


Service := TAmazonStorageService.Create(ConAmazon);

Response := TCloudResponseInfo.Create;

bResult := Service.GetObject('ctl-test52', 'ctl_t.txt', Text_Stream, Response);

if bResult = True then
ShowMessage(Response.StatusMessage)
else
ShowMessage('Upload fails' #13 IntToStr(Response.StatusCode) ' -> ' Response.StatusMessage)
Finally
Text_Stream.Free;
Service.Free;
ConAmazon.Free;
end;
end;


會出現 400-> HTTP/1.1 400 Bad Request 錯誤

附加檔案:61aedcd48afeb_1.jpg
編輯記錄
chris681016 重新編輯於 2021-12-07 12:25:10, 註解 無‧
系統時間:2024-04-29 3:27:34
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!