Files
Comparison_Project/app/utils/file_utils.py

26 lines
501 B
Python
Raw Normal View History

import os
2026-03-18 10:19:11 +05:30
from flask import current_app
2026-03-18 17:18:05 +05:30
# file extension
ALLOWED_EXTENSIONS = {"xlsx", "xls", "csv"}
2026-03-18 10:19:11 +05:30
def get_download_format_folder():
return os.path.join(
current_app.root_path,
"static",
"downloads",
"format"
)
2026-03-18 17:18:05 +05:30
def get_uploads_folder():
return os.path.join(
current_app.root_path,
"static",
"uploads"
)
def ensure_upload_folder():
2026-03-18 17:18:05 +05:30
if not os.path.exists(get_uploads_folder()):
os.makedirs(get_uploads_folder())