Skip to content

Commit

Permalink
Bug fix: Alexandre Magno
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Nov 27, 2024
1 parent da2a4d4 commit 296b8bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/RESTRequest4D.Request.FPHTTPClient.pas
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ function TRequestFPHTTPClient.AddFile(const AFieldName: string; const AFileName:
function TRequestFPHTTPClient.AddFile(const AFieldName: string; const AValue: TStream; const AFileName: string; const AContentType: string): IRequest;
var
LFile: TFile;
LFileName: string;
begin
Result := Self;
if not Assigned(AValue) then
Expand All @@ -543,7 +544,11 @@ function TRequestFPHTTPClient.AddFile(const AFieldName: string; const AValue: TS
begin
if not FFiles.ContainsKey(AFieldName) then
begin
LFile := TFile.Create(AValue, AFileName, AContentType);
LFileName := AFileName;
if LFileName.Trim.IsEmpty then
LFileName := AFieldName;

LFile := TFile.Create(AValue, LFileName, AContentType);
FFiles.AddOrSetValue(AFieldName, LFile);
end;
end;
Expand Down

0 comments on commit 296b8bc

Please sign in to comment.