1

I have a client/server architecture in which the client needs to periodically download large files from the server. Let's say the client downloads 9Gb of a 10Gb file and then temporarily loses internet connection. When the client regains connection, I would like the client to be able to download the remaining 1Gb of the file rather than need to re-download everything from scratch.

Is there any platform, libraries, frameworks, etc. which handles this? If not, does anyone have any ideas on how to best approach this problem?

Server/Client Technologies

Server - Python / Django / Django REST Framework

Client - Android / iOS / c++

Current Server Code

def post(self, request):
try:
    user = request.user
    file = MyFile.objects.filter(user_id=user)
    response = FileResponse(open(file.path, 'rb'))
    return response
except Exception as e:
    return Response({'status': str(e)}, content_type="application/json")
Espresso
  • 740
  • 13
  • 32

1 Answers1

1

I did not try it but you may try to implement the range header support in the file serving view and try it. There is chance browsers are sending the header by default.

Chrome and range requests

Sample PHP implementation

HTTP range requests

How to make range request

Kryštof Řeháček
  • 1,965
  • 1
  • 16
  • 28