2025-12-11 10:16:43 +05:30
|
|
|
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"}
|
2025-12-11 10:16:43 +05:30
|
|
|
|
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"
|
|
|
|
|
)
|
|
|
|
|
|
2025-12-11 10:16:43 +05:30
|
|
|
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())
|