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
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:
Example 7 on this page:
please any body help how to implement it in B4A
Thanks
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)
It seems that Jetty does not support partial download as easy as IIS web server.
there are some links that explain this:
Jetty 9 client setting Content-Range value properly not working
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();
stackoverflow.com
Example 7 on this page:
Java Code Examples of org.eclipse.jetty.server.Request
This page provides Java code examples for org.eclipse.jetty.server.Request. The examples are extracted from open source Java projects from GitHub.
www.javased.com
please any body help how to implement it in B4A
Thanks