If Job.JobName = "DownloadImage" Then
Dim m As Map = Job.Tag
Dim OutStream As OutputStream
Log("DownloadReady: "&Job.Tag)
OutStream = File.OpenOutput(File.DirRootExternal, m.Get("filename"), False)
File.Copy2(Job.GetInputStream,OutStream) ' save the file
OutStream.Close
Log(m.Get("filename")&" is written to "&File.DirRootExternal)