myfiletype = {"docx": "application/zip", "pdf": "application/pdf", "pptx": "application/zip",
"xlsx": "application/zip"}
type1 = myfiletype[os.path.splitext(filepath)[-1].replace(".", "")]
type2 = ftype.guess(filepath).mime
if type1 == type2:
print("ok")
python 使用filetype校验文件
最新推荐文章于 2022-12-16 22:30:00 发布