From 17f63125b1d843f944a816b4427f6998bf4ff4a1 Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:58:23 -0500 Subject: [PATCH] Save uploaded files to uploads/job_id folder instead of temp dirs - Create job_id first, then save files to uploads/job_id/ - Add debug print when index() is called - Files will now be visible in uploads folder for debugging --- app.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index ee5fc03..f50d0ec 100644 --- a/app.py +++ b/app.py @@ -352,6 +352,7 @@ def save_jobs(jobs): @app.route('/', methods=['GET', 'POST']) @login_required def index(): + print(f"DEBUG: index() called with method={request.method}") global processing_complete, current_output_dir if request.method == 'POST': print(f"POST request received at {datetime.now()}") @@ -363,8 +364,13 @@ def index(): # Clean up any previous processing cleanup_temp_files() - # Create temp dirs - input_dir = tempfile.mkdtemp() + # Create job ID first + job_start_time = datetime.now() + job_id = job_start_time.strftime('%Y%m%d_%H%M%S') + + # Create dirs + input_dir = os.path.join('uploads', job_id) + os.makedirs(input_dir, exist_ok=True) output_dir = tempfile.mkdtemp() current_output_dir = output_dir @@ -390,8 +396,6 @@ def index(): print(f"Saved file from folder: {filename}") # Create job immediately - job_start_time = datetime.now() - job_id = job_start_time.strftime('%Y%m%d_%H%M%S') jobs = load_jobs() jobs[job_id] = { 'id': job_id,