From d9e8a2932663dfcd924102aa93392368d3fdbd43 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 27 Dec 2025 18:15:02 -0500 Subject: [PATCH] new paths --- app/api/routes/routes.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/api/routes/routes.py b/app/api/routes/routes.py index 8a4336e..a3eec81 100644 --- a/app/api/routes/routes.py +++ b/app/api/routes/routes.py @@ -109,7 +109,7 @@ def merms_register_complete(): return response -UPLOAD_FOLDER = '/app/uploads' # '/uploads' +UPLOAD_FOLDER = '/app/uploads' # '/uploads' ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'} @@ -144,17 +144,20 @@ def upload_file(): if file and allowed_file(file.filename): logger.info(f'POST CALLED 5 {file.filename}') # logger.info(f'POST CALLED 5 {file.size}') + save_path=UPLOAD_FOLDER + "/" + "F000000000001" filename = secure_filename(file.filename) - final_save_path = os.path.join(UPLOAD_FOLDER, filename) + final_save_path = os.path.join(save_path, filename) logger.info(f'POST CALLED 6 {final_save_path}') try: + if not os.path.isdir(save_path): + os.makedirs(save_path) + file.save(final_save_path) except Exception as e: # Catches any other exception and stores the message in 'e' print(f"An unexpected error occurred: {e}") - if request.method == 'GET': logger.info('GET CALLED')