Hello,
With OKHttputilis2 I want to download text in a file.txt from a server and put it into a variable.
I Know to download an image and I use this Sub which runs fine
How to modify this sub to download text that is in a file.txt on the server ant put it into a string variable
The sub below does'nt run.
Thank you
With OKHttputilis2 I want to download text in a file.txt from a server and put it into a variable.
I Know to download an image and I use this Sub which runs fine
B4X:
Sub DownloadImage(Link As String, iv As ImageView)
Dim j As HttpJob
j.Initialize("", Me)
j.Download(Link)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
iv.Bitmap = j.GetBitmap
End If
j.Release
End Sub
The sub below does'nt run.
Thank you
B4X:
Sub DownloadString(Link As String, TheString As String )
Dim j As HttpJob
j.Initialize("", Me)
j.Download(Link)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
TheString = j.GetString
Log(j.GetString)
End If
j.Release
End Sub