最后还是用验证zip file的方式来做了。因为我所拿到的都是 zip file,如果最后部
分没有上传上来的话,unzip -v 会说:
unzip -v a1.zip
Archive: a1.zip
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of a1.zip or
a1.zip.zip, and cannot find a1.zip.ZIP, period.
(Exit code = 9)
而用python的 zipfile.is_zipfile(filelocation) 就会得到 false.
所以我用这个就足够判断了。
谢谢大家的讨论。