From c7ddc0f5905db5771b933ae6de1d8931346bfb46 Mon Sep 17 00:00:00 2001 From: Aiirondev_dev Date: Mon, 13 Jul 2026 10:17:35 +0000 Subject: [PATCH] Website/main.py aktualisiert --- Website/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Website/main.py b/Website/main.py index d145a78..1b9d3b9 100644 --- a/Website/main.py +++ b/Website/main.py @@ -1954,6 +1954,16 @@ def register(): return render_template("register.html") +@app.route('/download-sample') +def download_sample(): + # Ensure the file is only served from the specific directory + directory = os.path.join(app.root_path, 'static', 'downloads') + try: + return send_from_directory(directory, 'download_sample.pdf', as_attachment=True) + except FileNotFoundError: + abort(404) + + @app.route('/preise', methods=['GET']) def preise(): return render_template("preise.html")