Hi,
My previous file server was a Windows IIS and I could download a larg file on my b4a app easily.
if download would fail meanwhile I could resume download using
B4X:
Dim request As OkHttpRequest
request.InitializeGet(myURL & "/" & myFilename & "?dumyParam=" & Rnd(10000,1999999999) & Rnd(10000,1999999999)) ' dumyParam helps avoid browser cach
If PreviouslyDownloadedsize > 0 And PreviouslyDownloadedsize < TotalBytes Then
request.SetHeader("Range","bytes=" & PreviouslyDownloadedsize & "-")
End If
HC.Execute(request, 4)
But I now I am using a B4J server.
It seems that Jetty does not support partial download as easy as IIS web server.
there are some links that explain this:
I'm using Jetty 9.4 HttpClient to try and restart a large file download. I'm using Jetty 9.4 server. final InputStreamResponseListener listener = new InputStreamResponseListener();
since I am using a CountingOutputStream as Target of Response.GetAsynchronously("Response", Target, True, TaskId)
so in stead of httputils2, I prefered to make my custome httputil which borrows mosty from httputils2