Downloading is really simple and works great, but I cannot find a simple way to upload a file.
Is there one?
Is there one?
B4X:
' UPLOADING
Dim Job As HttpJob
Job.Initialize( "j", Me)
Job.Download("http://www.something.xx/" & Filename)
.
.
.
Sub JobDone(job As HttpJob)
If job.Success Then
Dim RootFolder As String
RootFolder=File.DirRootExternal
Dim out As OutputStream = File.OpenOutput(RootFolder, Filename, False)
File.Copy2( job.GetInputStream, out)
out.Close
Else
Log("Error: " & job.ErrorMessage)
End If
job.Release
End Sub
' DOWNLOADING
Dim Job As HttpJob
Job.Initialize( "j", Me)
Job.Upload(Filename, "http://www.something.xx/")