Need Help With FTP
revdev at pdslabs.net
Thu Apr 23 18:43:11 EDT 2015
I would probably use the "load" command because it's a non-blocking way
to do it - it doesn't prevent interaction while it's working.
Maybe something like this (I didn't test this):
-- button --
-- card or stack --
# fld "status"
# fld "my links"
# fld "folderpath"
local sUrlList, sTotal, sCurrent=0
put fld "my links" into sUrlList
put (the number of lines in sUrlList) into sTotal
-- let user know what's happening
add 1 to sCurrent
put ("downloading" && sCurrent && "of" && sTotal) into fld "status"
load url (line sCurrent of sUrlList) with message "_saveFile"
set the itemDel to slash
get (line sCurrent of sUrlList)
put url it into url ("binfile:" & fld "folderpath" & "/" & last
item of it)
unload url it
if sCurrent < sTotal then
send "_download" to me in 1 tick -- get the next file
put empty into fld "status"
answer "all files downloaded!"
exit to top
On 4/23/15 2:18 PM, Gregory Lypny wrote:
> Hello everyone,
> I’m working on a big research project that requires that I download many small files (under 2MB) from the US Security and Exchange Commission’s (SEC) public FTP site. I have the links to all of the files I need, and I’m wondering how I would use a LiveCode “repeat with” loop to download the files while avoiding a session timed-out error.
> Any tips would be much appreciated.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode