R RichardN Well-Known Member Licensed User Longtime User Jun 22, 2016 #1 I was just trying to download a single file from my web-server using the HTTPjob & HTTPutils2Service classes. The code is something like..... Code: Copy Dim Job1 as HTTPjob Job1.Initialize("DatabaseFile",Me) Job1.Download("http:/www.mywebspace.com/files/index1.db") Sub JobDone (Job As HttpJob) If Job.Success = True Then Select Job.JobName Case "DatabaseFile" Log (Job.JobName & " Was Download") Case ELSE Log("Some Other Job Downloaded") End Select Else Log("Download Failed") End If Job.Release End Sub The code runs without error. The flow through the code-path is also as expected, but there is no evidence of any file downloaded to any likely place like File.DirLibrary/Documents/Temp. There appears to be no reference example I can find that indicates what I am doing wrong. What am I missing ???
I was just trying to download a single file from my web-server using the HTTPjob & HTTPutils2Service classes. The code is something like..... Code: Copy Dim Job1 as HTTPjob Job1.Initialize("DatabaseFile",Me) Job1.Download("http:/www.mywebspace.com/files/index1.db") Sub JobDone (Job As HttpJob) If Job.Success = True Then Select Job.JobName Case "DatabaseFile" Log (Job.JobName & " Was Download") Case ELSE Log("Some Other Job Downloaded") End Select Else Log("Download Failed") End If Job.Release End Sub The code runs without error. The flow through the code-path is also as expected, but there is no evidence of any file downloaded to any likely place like File.DirLibrary/Documents/Temp. There appears to be no reference example I can find that indicates what I am doing wrong. What am I missing ???
Erel B4X founder Staff member Licensed User Longtime User Jun 23, 2016 #2 You need to copy Job.GetInputStream: Code: Copy Dim out As OutputStream = File.OpenOutput(File.DirLibrary, "1.dat", False) File.Copy2(Job.GetInputStream, out) out.Close Upvote 0
You need to copy Job.GetInputStream: Code: Copy Dim out As OutputStream = File.OpenOutput(File.DirLibrary, "1.dat", False) File.Copy2(Job.GetInputStream, out) out.Close