Hi, I'm trying to download a zip file from a hosting using http and it shows me the error:
This is the code.
Regards.
I've been looking at several threads on similar topics and I can not find the problem.java.lang.IllegalArgumentException: Host name may not be null
This is the code.
B4X:
Sub DownloadZip( cZip As String )
Dim j As HttpJob
j.Initialize("", Me)
j.Download( "http://www.mydomain.com/directory/afile.zip" )
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Dim out As OutputStream = File.OpenOutput(File.DirRootExternal, "filename.dat", False)
File.Copy2(j.GetInputStream, out)
out.Close
Else
ToastMessageShow("Could not download",False)
End If
j.Release
End Sub