def generate_tmpfile(file):
"""
????
@file: ????
"""
u = uuid.uuid1()
name, ext = os.path.splitext(file.filename)
_filename = ''.join([u.hex, ext])
path = '/'.join(['', current_app.config["TMP_PATH"], _filename])
tmp_path = ''.join([current_app.root_path, path])
file.save(tmp_path)
return (path, name)
评论列表
文章目录