# 1、上传多个文件

@api.route("/download", methods=['POST'])
def download():
    result = apiResult()
    file=request.files.getlist('file')
    if len(file)==0:
        result.setCode(300)
        result.setMsg('未检测到上传文件')
        return jsonify(result.__dict__)
    for f in file:
        f.save(f'//Users/liuhuan/Downloads/'+f.filename)
    return jsonify(result.__dict__)
1
2
3
4
5
6
7
8
9
10
11