Sub DownloadImage(Link As String, filename As String)
Dim job As HttpJob
job.Initialize("", Me) 'note that the name parameter is no longer needed.
job.Download(Link)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
Dim out As OutputStream = File.OpenOutput(File.DirApp, "test.jpg", False)
File.Copy2(job.GetInputStream, out)
out.Close
End If
job.Release
End Sub