Copy File From Local Server

Dallas Williams

Member
Licensed User
Longtime User
I'm working on a project where I need to copy various files from my local webserver (eventually I need to save different files back to the server)

In debug I get the following error at StartService(HttpUtilsService)
java.lang.RuntimeException: Code module does not support this method.

I have been struggling with HttpUtils Lib, could anyone kindly point out where I might be going wrong.

B4X:
Sub Process_Globals
   Dim Network_On,Single_User,Use_Next,Show_Hint,Silent_Update As Boolean
   Dim Main_Screen,Adj_Screen,ProAm_Start As Int
   Dim Scrut_PW,IP_Address As String
   Dim ro_url As List
End Sub


Sub Get_RunOrder
HttpUtils.CallbackActivity = "runningorder"
HttpUtils.CallbackJobDoneSub = "JobDone"
HttpUtils.CallbackUrlDoneSub = "UrlDone"
   ro_url.Initialize
   ro_url.AddAll(Array As String("http://192.168.1.254/Recalls/RunOrder_Tablet.txt"))
HttpUtils.Download("Job1", ro_url)
End Sub
Sub UrlDone(Url As String)
    Log(Url & " done")
End Sub
Sub JobDone (Job As String)
Dim therunorder As InputStream
    Select Job
        Case "Job1"
            For i = 0 To HttpUtils.Tasks.Size - 1
                link = HttpUtils.Tasks.Get(i)
            Next
                        If HttpUtils.IsSuccess(ro_url) Then
                Log(link & ": success=" & HttpUtils.IsSuccess(link))
                              therunorder = HttpUtils.GetInputStream(ro_url)
                              Dim out As OutputStream
                              Log(ro_url)
                             Log(File.Exists(File.DirDefaultExternal,"RunOrder_Tablet.txt"))
                              out = File.OpenOutput(File.DirDefaultExternal,"RunOrder_Tablet.txt",False)
                              Log(File.DirDefaultExternal)
                              File.Copy2(therunorder , out)
                              out.Close
                        End If
    End Select
End Sub
 
Last edited:
Top