TIdHTTP has two overloaded versions of Post() that accept the file name as input:
var Response: String; Response := IdHTTP1.Post('https://www.example.com/ex/exampleAPI.asmx/Process', 'c:\filename.txt');
.
var Response: TStream; Response := TMemoryStream.Create; IdHTTP1.Post('https://www.example.com/ex/exampleAPI.asmx/Process', 'c:\filename.txt', Response); ... Response.Free;
Note that you are sending an HTTPS URL, so you must first assign an SSL-enabled TIdSSLIOHandlerSocketOpenSSL , such as TIdSSLIOHandlerSocketOpenSSL , to the TIdHTTP.IOHandler property.
Remy Lebeau
source share