RosettaCodeData/Task/FTP/Lingo/ftp.lingo

19 lines
462 B
Plaintext

CURLOPT_URL = 10002
ch = xtra("Curl").new()
url = "ftp://domain.com"
-- change to remote dir "/foo/bar/"
put "/foo/bar/" after url
ch.setOption(CURLOPT_URL, url)
res = ch.exec(1)
-- print raw FTP listing as string
put res.readRawString(res.length)
-- download file "download.mp3" (passive mode is the internal default behavior)
filename = "download.mp3"
ch.setOption(CURLOPT_URL, url & filename)
ch.setDestinationFile(_movie.path & filename)
res = ch.exec()