blazer icon indicating copy to clipboard operation
blazer copied to clipboard

skip download if file already downloaded

Open arvpo opened this issue 4 years ago • 4 comments

  • check bytes and then verify download completion

arvpo avatar Aug 01 '21 13:08 arvpo

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?

setraj avatar Aug 07 '21 17:08 setraj

Good point, to make the user experience better, we can make a prompt to user for further actions

cases:

  1. If (name & size) matches => prompt user for action (y/n)=> if yes => start download with file_name-1.ext

  2. 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

arvpo avatar Aug 07 '21 21:08 arvpo

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.

setraj avatar Aug 08 '21 21:08 setraj

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

arvpo avatar Aug 08 '21 21:08 arvpo