I restart this post because I have a similar problem: download a hole folder from "MY" web site.
Actually, in order to list the content of a directory, I am using TsNet with this code (works on OSX and mobile). No PHP needed:
Code: Select all
function ListWebFolderContent
--gWebMirror is a global array with gWebMirror["username"]["xxx"] and gWebMirror["password"]["yyy"]
tsNetSetTimeouts 30, 0, 5000, 60000, 30, 1000
put tsNetCustomSync("ftp://ftp.mydomain.it//www.mydomain.it/myfolder/", "NLST", tHeaders, tRecvHeaders, tResult, tBytes,gWebMirror["settings"]) into tData
if tResult is not 226 then --something is wrong
put tResult & cr & tRecvHeaders into msg
else --got list of myfolder content
filter lines of tData where char 1 of each <> "." --directory list contains a few "." and ".."
if tData is empty then
put "The folder is empty" & cr & tResult & cr & tRecvHeaders into msg
else
return tData
end if
end if
end ListWebFolderContent
My user case is that my standalone, when needed, is updating itself downloading from my web site a folder, which replace the existing one inside the standalone.
The content of the folder is mixed (files and folders) and around 40MB.
I am wondering which is the best way for the download: should I have the web folder zipped and unzip it on arrival? Or using TsNet I may be able to download a "hole" unzipped folder?
UnZipping on LC10 takes a while and I would avoid that.