mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-09 09:14:38 +01:00
33 lines
491 B
ObjectPascal
33 lines
491 B
ObjectPascal
program httppostfile;
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
uses
|
|
{$ifdef unix}
|
|
cwstring,
|
|
{$endif}
|
|
SysUtils, Classes, fphttpclient, opensslsockets;
|
|
|
|
Var
|
|
F : TFileStream;
|
|
Vars : TStrings;
|
|
|
|
begin
|
|
With TFPHTTPClient.Create(Nil) do
|
|
begin
|
|
F:=TFileStream.Create('response.html',fmCreate);
|
|
try
|
|
Vars:=TstringList.Create;
|
|
try
|
|
FileFormPost(ParamStr(1),'myfile',paramstr(2),f);
|
|
finally
|
|
Vars.Free;
|
|
end;
|
|
finally
|
|
F.Free;
|
|
end;
|
|
end;
|
|
end.
|
|
|