N
N
Nicholas2016-10-06 19:12:21
Node.js
Nicholas, 2016-10-06 19:12:21

How to download content from a resource with an unstable connection?

There is a site where the video and the download speed is about 5kb =) and the download of files often breaks (
In general, how can you implement downloading content from it, taking into account breaks and how to implement resume download
? ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
T_y_l_e_r, 2016-10-06
@T_y_l_e_r

A task in any language is implemented using a temporary file.
First, we check the size of the downloaded file, then we check the buffer, how much has already been downloaded, and then we download from the place of the break.
Before all this, you need to check the size of the downloaded file and the size of the buffer, if they do not match, throw it on resume.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question