()
文件上传
文件上传
文件上传
def api_upload():
    """ 文件上传 """
    data = request.files
    # try:
    file = data['file']
    skip = request.form.get('skip')
    # print(request.form)
    if os.path.exists(os.path.join(FILE_ADDRESS, file.filename)) and not skip:
        return jsonify({"msg": "文件已存在，请修改文件名字后再上传", "status": 0})

    else:
        file.save(os.path.join(FILE_ADDRESS, file.filename))
        return jsonify({'data': os.path.join(FILE_ADDRESS, file.filename), "msg": "上传成功", "status": 1})
def api_upload ( ) : data = request . files # try: file = data [ 'file' ] skip = request . form . get ( 'skip' ) # print(request.form) if os . path . exists ( os . path . join ( FILE_ADDRESS , file . filename ) ) and not skip : return jsonify ( { "msg" : "文件已存在，请修改文件名字后再上传", "status": 0}) else : file . save ( os . path . join ( FILE_ADDRESS , file . filename ) ) return jsonify ( { 'data' : os . path . join ( FILE_ADDRESS , file . filename ) , "msg" : "上传成功", "statu s : 1})