2025-11-30 16:24:49 +05:30
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
class FileHandler:
|
|
|
|
|
ALLOWED_EXTENSIONS = {'pdf', 'docx', 'doc', 'xlsx', 'xls'}
|
|
|
|
|
UPLOAD_FOLDER = os.path.join('static', 'uploads')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def CHeckExistingOrCreateNewUploadFolder():
|
2026-02-18 18:00:20 +05:30
|
|
|
# Whether path exists
|
2025-11-30 16:24:49 +05:30
|
|
|
os.makedirs(FileHandler.UPLOAD_FOLDER, exist_ok=True)
|
2025-12-02 15:38:19 +05:30
|
|
|
return
|
2026-02-18 18:00:20 +05:30
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
def CheckExistingOrCreateNewLoggerFolder():
|
|
|
|
|
if not os.path.exists("logs"):
|
|
|
|
|
os.mkdir("logs")
|
|
|
|
|
return
|