Sub get_images
HttpUtils.CallbackActivity = "Main" 'Current activity name.
HttpUtils.CallbackJobDoneSub = "JobDone"
'HttpUtils.Download("Job1", FileUrl)
Dim file_to_add As String
file_list.Initialize
cursor1=sql1.ExecQuery("Select * from images")
For i=0 To cursor1.RowCount-1
cursor1.Position=i
file_to_add="http://mywebserver/images/" & """" & cursor1.GetString("IMAGE_FILE") & """"
file_list.Add(file_to_add)
Next
HttpUtils.DownloadList("Job2", file_list)
End Sub
Sub JobDone (Job As String)
Dim link As String
Dim file_name As String
For i = 0 To HttpUtils.Tasks.Size - 1
link = HttpUtils.Tasks.Get(i)
file_name=link.SubString(27) 'extracts just the filename from file_to_add
File.Copy2(HttpUtils.GetInputStream(link),File.OpenOutput(File.DirDefaultExternal,file_name,False))
Log(link & ": success=" & HttpUtils.IsSuccess(link))
Next
Msgbox("DONE","")
End Sub