update: dataset
chore: disable upload function feat: add run.sh
This commit is contained in:
@@ -7,23 +7,23 @@ app = Flask(__name__)
|
||||
# 成绩文件的路径
|
||||
csv_file_path = "scores.csv"
|
||||
|
||||
# 上传文件的路径
|
||||
# # 上传文件的路径
|
||||
UPLOAD_FOLDER = "./uploads"
|
||||
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
||||
|
||||
|
||||
@app.route("/upload", methods=["POST"])
|
||||
def upload_file():
|
||||
if "file" not in request.files:
|
||||
return jsonify({"error": "No file part"}), 400
|
||||
# @app.route("/upload", methods=["POST"])
|
||||
# def upload_file():
|
||||
# if "file" not in request.files:
|
||||
# return jsonify({"error": "No file part"}), 400
|
||||
|
||||
file = request.files["file"]
|
||||
if file.filename == "":
|
||||
return jsonify({"error": "No selected file"}), 400
|
||||
# file = request.files["file"]
|
||||
# if file.filename == "":
|
||||
# return jsonify({"error": "No selected file"}), 400
|
||||
|
||||
# 保存文件到指定目录
|
||||
file.save(os.path.join(UPLOAD_FOLDER, file.filename))
|
||||
return "File uploaded successfully"
|
||||
# # 保存文件到指定目录
|
||||
# file.save(os.path.join(UPLOAD_FOLDER, file.filename))
|
||||
# return "File uploaded successfully"
|
||||
|
||||
|
||||
@app.route("/download/<filename>", methods=["GET"])
|
||||
|
||||
Reference in New Issue
Block a user