There is a ftp demo by Tonton Luc for uploading/downloading files.
However this program is rather complex and huge, and uses the old 5xVIP.
For downloading, there is a Windows API called "urlDownloadToFile" which
can do the job. This API needs urlmon.dll which is present in all Windows.
In your program, add the lines:
Code: Select all
resolve
urlDownloadToFile externally % This needs urlmon.lib
class predicates
urlDownloadToFile: (unsigned,string URL,string File,unsigned32 Reserved,unsigned Callback) -> unsigned32 Hresult
procedure language stdcall as "_URLDownloadToFileW@20".
clauses
dodownload(SourceURL,Destfile):-
Hresult = urlDownloadToFile(0,SourceURL,Destfile,0,0),
Hresult = 0,
(etc.)
For uploading, I use a DOS script and the built-in FTP program in Windows.
For example I create the following script.txt file:
Code: Select all
open ftphostname
myname
mypassword
put filename
bye
ftp -s:script.txt
Any comments or suggestions are welcome.
Chan Bok
Axon Research