ReceiveHTTPFile() with offset
Posted: Mon Aug 08, 2016 10:52 am
When downloading large files it's rather annoying when the download fails (maybe halfway though) and the file has to be downloaded all over again.
Would it be possible to:
a) Give us the bytes already downloaded after a download fail (or a download abort).
The docs are a little unclear about whether FinishHTTP() needs to be called regardless of progress, it is my understanding that the connection only needs to be 'finished' if the progress is 'successful', meaning all other error states indicate the connection has already been cleaned up.
I would propose having to call FinishHTTP() in ALL cases. This would make HTTPProgress() bulletproof as the connection handle would always be valid until freed.
b) Let us specify the start offset of the file (so we may 'resume' the download).
Result = ReceiveHTTPFile(URL$, Filename$ [[, Flags], StartPosition]
This wouldn't break existing code.
or c) Give us a ResumeHTTPFile(httpconnection) function to resume/retry aborted downloads.
This would allow download clients to pause and resume downloads as well.
Not sure if this is at all possible, I am asking this mainly because I have had this problem with HTTP file downloading, however it might also be useful to implement this in the FTP libs too.
Would it be possible to:
a) Give us the bytes already downloaded after a download fail (or a download abort).
The docs are a little unclear about whether FinishHTTP() needs to be called regardless of progress, it is my understanding that the connection only needs to be 'finished' if the progress is 'successful', meaning all other error states indicate the connection has already been cleaned up.
I would propose having to call FinishHTTP() in ALL cases. This would make HTTPProgress() bulletproof as the connection handle would always be valid until freed.
b) Let us specify the start offset of the file (so we may 'resume' the download).
Result = ReceiveHTTPFile(URL$, Filename$ [[, Flags], StartPosition]
This wouldn't break existing code.
or c) Give us a ResumeHTTPFile(httpconnection) function to resume/retry aborted downloads.
This would allow download clients to pause and resume downloads as well.
Not sure if this is at all possible, I am asking this mainly because I have had this problem with HTTP file downloading, however it might also be useful to implement this in the FTP libs too.