I’ve checked out the usefule link how to download a file from internet using Delphi and my question related but I would appreciate a pointer to get started. I need to be able to copy all files in a web server folder down to a local folder. I wont know how many files there are, or indeed whether there is an internet connection. Are there component(s) that would help me please? Or can I use Windows API?
Thanks
Brian
I’ve checked out the usefule link how to download a file from internet using
Share
I’d start with this answer and in stead of putting the output result in a string, write the buffer to a TFileStream.
WinInet is really nice, as it respects the proxy settings the user set on Windows (so you don’t have to put a lot of work into how to make that configurable with Indy).
Edit:
I refactored that answer a bit to download binary files.
Since it uses WinInet you can use it for both ftp and http download (yes, I checked that it did).
You can extend this to use FtpFindFirstFile/InternetFindNextFile and read a whole bunch of files.
–jeroen