python将zip文件解压到指定目录
2020-12-13 03:30
阅读:576
标签:upload 同文件 zip file shu files obj 生成 path python将zip文件解压到指定目录 标签:upload 同文件 zip file shu files obj 生成 path 原文地址:https://www.cnblogs.com/ttyypjt/p/11077549.htmlimport shutil
file_obj = request.files.get(‘code‘) # form表单提交的文件对象
target_path = os.path.join(‘uploadfiles‘, str(uuid.uuid4())) # 为了防止覆盖相同文件,在上传目录下随机生成一个目录
shutil._unpack_zipfile(file_obj, target_path) # 获取form表单提交的文件对象后,直接解压到指定目录
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:python将zip文件解压到指定目录
文章链接:http://soscw.com/index.php/essay/27716.html
文章标题:python将zip文件解压到指定目录
文章链接:http://soscw.com/index.php/essay/27716.html
评论
亲,登录后才可以留言!