new paths
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user