From 167e59c26b0fb8461aea03d9d69f90c564b49aae Mon Sep 17 00:00:00 2001 From: wuzekai <3025054974@qq.com> Date: Tue, 8 Jul 2025 05:19:32 +0000 Subject: [PATCH] Update ocr.py --- ocr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ocr.py b/ocr.py index 36402fa..1a54ce2 100644 --- a/ocr.py +++ b/ocr.py @@ -23,4 +23,8 @@ os.makedirs(result_dir, exist_ok=True) @ocr.route("/process", methods=["POST"]) def ocr_inference(): if "file" not in request.files: - return jsonify({"error": "No file provided"}), 400 \ No newline at end of file + return jsonify({"error": "No file provided"}), 400 + + file = request.files["file"] + if file.filename == "": + return jsonify({"error": "No selected file"}), 400 \ No newline at end of file -- 2.22.0