Is there a easy and reliable way to confirm that a web download completed successfully to download using Python or WGET [for large files]? I want to make sure the file downloaded in its entirety before performing another action.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Given many (most in practice, I believe) HTTP/1.1 header sections, you can get an expectation about how long the entity body is. If you have that expectation, you can decide if you got all the entity data. See RFC 2616 section 4.4 for full details, but essentially:
content-lengthaccurately reflects the length of the entity bodyHEADrequestTransfer-Encoding: chunked)In all cases but the last one, you can tell if you’ve got the whole thing or not. I don’t know if any tool in particular (wget or an existing python library) gives you an easily interpretable signal that your response was or wasn’t truncated.