Closed freedaun closed 9 years ago
Hi Marcos, I am under pressure and I need to have this feature by the 21th. So I did this and it seems to work:
function TAWSS3Client.GetObject(const ABucket, AObjectName: string; AStream: TStream): Integer; begin FHTTP.Clear; SetAuthHeader('GET', '', '', '', '/' + ABucket + '/' + AObjectName); Result := Send('GET', ABucket, '/' + AObjectName); FHTTP.Document.SaveToStream(AStream); // needs error checking?? end;
function TAWSS3Client.GetObject(const ABucket, AObjectName, AFileName: string): Integer; var Buf: TFileStream; begin Buf := TFileStream.Create(AFileName, fmCreate); try Result := GetObject(ABucket, AObjectName, Buf); // above if result <> 200 then deleteFile(AFilename); finally Buf.Free; end; end;
What worries me most is the SaveToStream part: it has no error checking.
Done in bef9a7fcc87136429be6c290af54e5ee5df523eb
Hi Marcos, the title says it all. Abraço.