企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
python后台代码的示例(感谢QQ群 *@隔壁杨师傅* 的提供) ```python # coding=utf-8 __author__ = 'Next door to Master Yang' import os from flask import Flask, request,Response app = Flask(__name__) app.config['UPLOAD_FOLDER'] = "static" @app.route("/upload",methods = ["POST"]) def GetImage(): file = request.files['wangEditorMobileFile'] if file == None: return "error|file is not exist" else: try: filename = file.filename file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) result = "static/"+filename res = Response(result) res.headers["ContentType"] = "text/html" res.headers["Charset"] = "utf-8" return res except Exception,e: print(e) return "error|"+str(e) ```