_19@app.route('/api/upload/', methods=['POST'])_19def upload():_19 # 获取文件_19 uploaded_file = request.files['file']_19 # 文件后缀(文件全名-> request.files['file'].filename)_19 file_extension = uploaded_file.filename.split('.')[-1]_19 # MIME 类型_19 mimetype = uploaded_file.mimetype_19 # 保存到 当前文件夹+'files/'_19 save_target = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'files/', uploaded_file.filename)_19 # 创建/files_19 if not os.path.isdir(os.path.dirname(os.path.abspath(__file__)), 'files/'):_19 os.mkdir(os.path.dirname(os.path.abspath(__file__)), 'files/')_19 # 保存_19 uploaded_file.save(save_target)_19 # return看自己需求填写_19 return jsonify(_19 code=200_19 )