On 2018-04-07 10:20, Graeme Geldenhuys wrote: > And if you are really lazy... ;-)
And here's an even simpler version. -------- [ from Remy Lebeau ]------------------------- TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1.Post('https://www.example.com/ex/exampleAPI.asmx/Process', 'c:\filename.txt'); ....or.... 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 posting to an HTTPS URL, so you need to first assign an SSL-enabled IOHandler, such as TIdSSLIOHandlerSocketOpenSSL, to the TIdHTTP.IOHandler property beforehand. -------------------[ end ]------------------------ Can't get simpler than that! Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal