The client is pure HTMLCodeClick the link to download the file from the server. This is what I do on the server:
HTTP 1/1 200 OK
Content-Length = 500
Content-Type = application/octet-stream
Content-Disposition: attachment; filename = "1.zip"
After the above HTTP header is connected to the file stream I read, the client browser will be able to see the download box.
The problem is that the above Code seems to be able to only process small files. When there are large files, you must download them multiple times at a breakpoint. What information should the server return to the client browser? The client only has HTML pages ..
answer
To implement resumable data transfer, the HTTP request sent to the server must contain the range header and specify the start and end locations of the part to be downloaded. For example:
Range: bytes = 1000-2000
The server returns the part of the specified part according to the range instruction.