UE4 HTTP resumable upload

Here's a look at other people's ideas, the overall feeling is clearer:

1 After getting a download task, first request the file information once, you need to get the file length Content-Length, request ETag, final update time or md5 of the file generated by the server itself as the unique identifier of the download task file (this can prevent if Two download gaps, problems caused by source file replacement), and create a folder with a unique identifier under the predetermined path to store file fragments.

2 A subtask class, storing the subtask ID, the requested range, byte size and other data. The object of this class is responsible for requesting a task slice, and storing the requested data according to the identification number

FString SubTaskFileName = MD5Str + TEXT("_") + FString::FromInt(TaskID) + TEXT(".hcf");
FFileHelper::SaveArrayToFile(RawData, *(CurFilePath / SubTaskFileName));

3 Confirm the size of each fragment according to actual needs, divide the requested file length by the fragment size and divide it into several subtasks, create these subtasks one by one, allocate the requested data range, and execute the download request, mark it after the download is complete Status is Downloaded.

4 If the download is interrupted and the download is re-downloaded, the same process will be performed, and it will try to read the local folder with the logo, read the downloaded part, mark the downloaded part, and then continue the download.

5 After each segment is downloaded, judge all subtask arrays maintained. If all are downloaded, then splicing all downloaded segments by ID and storing them in the target file.

6 Clean up temporary files.
———————————————

Here is the original
link of the great god: https://blog.csdn.net/qq_43034470/article/details/116741198

I also found a video of the great god at station B developing a resumable upload plug-in, to be verified. The link is here:
[https://www.bilibili.com/video/BV1XK411A7x8?p=1&vd_source=0ddc1e4b409f43460af9cf5033f8155f]

Guess you like

Origin blog.csdn.net/weixin_41130251/article/details/126133639