skip download if file already downloaded
- check bytes and then verify download completion
I need a little clarification on this issue. If I understood it correctly, we need to check for the size of the file along with the name of the file here. I have one question here. If we found out that the file size doesn't match the content length but the file name is the same, in this case, can we proceed with the download? if yes then what do we do with the existing file?
Good point, to make the user experience better, we can make a prompt to user for further actions
cases:
-
If (name & size) matches => prompt user for action (y/n)=> if yes => start download with file_name-1.ext
-
If we found out that the file size doesn't match the content length but the file name is the same: This cannot happen because the final file could have existed if and only if all the segments had successfully downloaded. There exist a possibility, that during the final stage (merging downloaded segments), if there will be an interruption, then file may be incomplete but we need to test this claim. I haven't faced it during the download and testing phase
In case 2 above, the user could have a different useful file with the same name but less size in the same directory.
I believe we may proceed with the download everytime when the user tries with a file_name-{some_uniuqe_identifier} in case of file name collision.
In case 2 above, the user could have a different useful file with the same name but less size in the same directory.
I believe we may proceed with the download everytime when the user tries with a file_name-{some_uniuqe_identifier} in case of file name collision.
This is the best decision, fully agreed