Need Help Throttling Downloads From an FTP Site
jiml at netrin.com
Mon Sep 21 21:07:22 EDT 2015
Try this (untested):
put theListofFiles into lListOfFilePaths
if lListOfFilePaths = empty then exit getNextFile
put line 1 of lListOfFilePaths into remoteFilePath
—SET THE LOCAL FILE’S NAME HOWEVER YOU NORMALLY WOULD
put whatever into localFileName
libURLDownloadToFile ("ftp://anonymous:myEmailAddress@ftp.sec.gov/" & remoteFilePath),(exportFolderPath & "/" & localFileName ),"downloadComplete"
command downloadComplete pURL, pStatus
if pStatus = "error" or pStatus = "timeout" then
answer error "The file” && pURL && "could not be downloaded."
Basically it fetches the files one at a time.
No need for adding guessed-at delays.
More information about the use-livecode