new paths

This commit is contained in:
CHIEFSOFT\ameye
2025-12-27 18:15:02 -05:00
parent 07fb27fbf3
commit d9e8a29326
+6 -3
View File
@@ -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')