Merge branch 'dev-anish' of http://gitea.lcepl.org/pjpatil12/Comparison_Project into dev-anish

This commit is contained in:
2026-02-02 14:57:20 +05:30
commit 37dd118cbd
57 changed files with 4063 additions and 0 deletions

30
app/routes/file_format.py Normal file
View File

@@ -0,0 +1,30 @@
from flask import Blueprint, render_template, send_from_directory, abort, current_app
from app.utils.helpers import login_required
import os
file_format_bp = Blueprint("file_format", __name__)
@file_format_bp .route("/file_format")
@login_required
def download_format():
return render_template("file_format.html", title="Download File Formats")
@file_format_bp .route("/file_format/download/<filename>")
@login_required
def download_excel_format(filename):
download_folder = os.path.join(
current_app.root_path, "static", "downloads/format"
)
file_path = os.path.join(download_folder, filename)
if not os.path.exists(file_path):
abort(404)
return send_from_directory(
directory=download_folder,
path=filename,
as_attachment=True
)