I am going to write an application server(RESTFull API) to allow clients to download a zip file, but requirement is the download must be resume-able (开发者_如何转开发due to failure / Network disconnection).
Is there any special protocol made for this???
If yes please share some contents on this, I am not even able to find anything on google. I am trying to do this in Java(jersey). Thanks
There's no special protocol you need to know about for resumable downloads. HTTP defines the "Range" header. Clients use the Range header to specify which parts of a file they want to download.
Resumable downloads are implemented by keeping track of which parts of the file you have downloaded, and if interrupted, resuming where you left off.
Server-side, you usually only need to care about whether the asset being served is dynamic or static.
If it's static, the solution is usually as simple as making sure that your web server (Apache or whatever) has the Range header turned on and letting clients have at it.
If it's dynamic, you have to check for the presence of a Range header in the incoming HTTP request and then ensuring that you only serve the requested portion of the asset. There are some additional things to consider such as versioning, caching, etc. which I won't go into but hopefully you get the idea.
Hope that helps!
精彩评论