# Session 0007: FTP Progress Callbacks & Upload Button Fix **Date:** 2026-02-22 **Status:** Completed **Origin:** MDF Webseiten session 0038 --- ## Work Done - [x] Added FTP upload/download progress callbacks to `offsite.py` — prints every 5% with size info - [x] Increased FTP block size to 256KB for better throughput - [x] Added `flush=True` and `sys.stdout.reconfigure(line_buffering=True)` for SSE streaming compatibility - [x] Fixed Upload button — now passes exact filename through frontend → API (`?name=` param) → ops CLI; previously always uploaded the latest backup regardless of which row was clicked - [x] Added `cache: 'no-store'` to all `fetch()` calls in `app.js` to prevent stale UI state - [x] Added `renderBackups()` call after upload success and on upload modal close - [x] Added `/etc/tmpfiles.d/mdf-cleanup.conf` to auto-clean orphan `/tmp/tmp*` dirs older than 1 day - [x] Increased FTP data socket timeout to 300s for large transfers - [x] Verified via Playwright: LOCAL + OFFSITE badges display correctly, merge-by-filename works ## Key Decisions / Learnings - `sys.stdout.reconfigure(line_buffering=True)` is required for progress output to stream through SSE — buffered stdout swallows output - The upload endpoint must accept a `name=` param; generic "upload latest" is wrong UX when user clicks a specific row - `cache: 'no-store'` on all fetches is necessary — stale backup list after upload is confusing - Corrupt backup (`prod_backup_20260219_164913.tar.gz`) failed FTP at ~5% consistently — safe to delete --- **Tags:** #Session #OpsDashboard #Backups #FTP