hk@kordil.com 0 Posted January 28, 2021 (edited) Dear All, I would like to read this file from this below URL just like reading a local ASCII file. https://kordil.com/lic/test.txt I would like point this file and read the content. Could any of you share an easy C++ Builder source code with me please. Edited January 28, 2021 by hk@kordil.com Share this post Link to post
FPiette 383 Posted January 28, 2021 You need to first copy the file from the web server to your computer (in memory or on disk as you like). For that purpose you need a HTTPS component such as the one in ICS (Internet Component Suite http://wiki.overbyte.be and available from GetIT menu in Delphi IDE), or from Indy (Included in Delphi). Using that component you can download the file and then do whatever you need with it. Share this post Link to post
Der schöne Günther 316 Posted January 28, 2021 For something simple like this, The THTTPClient from System.Net.HttpClient.hpp is sufficient. Share this post Link to post
KodeZwerg 54 Posted February 25, 2021 (edited) If server accept http request without SSL, you could use InternetReadFile() api. This way your executable stay slim. //Edit Header should be in WinInet. 4 things you need InternetOpen() InternetOpenUrl() InternetReadFile() InternetCloseHandle() Edited February 25, 2021 by KodeZwerg Added more text. Share this post Link to post
Remy Lebeau 1394 Posted February 25, 2021 6 hours ago, KodeZwerg said: If server accept http request without SSL, you could use InternetReadFile() api. WinInet supports both HTTP and HTTPS. InternetReadFile() works just fine with HTTPS resources. Share this post Link to post