You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The frontend client-side validation allows files up to 50MB, but the server enforces a hard 25MB ceiling. Users with files between 25–50MB get no warning on the frontend but receive a server error on submit.
Root Cause
Three misaligned values:
app.py:12 — MAX_CONTENT_LENGTH = 25 * 1024 * 1024 (Flask hard limit, request is rejected before reaching any route handler)
backend/routes/uploads.py — /upload and /preview both hardcode if file_size_mb > 25:
frontend-vite/react-ts/src/components/labelUploader.tsx — both handleUpload and handlePreview use const maxSize = 50 * 1024 * 1024
The settings.py config has MAX_FILE_SIZE = 50MB (dev) / 25MB (prod), but the route handlers ignore this config and hardcode 25MB directly.
Impact
Users who select a file between 25–50MB will pass client-side validation but get a 413 error from the server with no clear explanation.
Fix Options
Align frontend down to 25MB — matches the current server reality, no backend changes needed
Raise the limit to 50MB everywhere — update MAX_CONTENT_LENGTH in app.py, both route handlers in uploads.py, and ProductionConfig.MAX_FILE_SIZE in settings.py
Option 2 requires verifying the hosting tier supports 50MB request bodies before proceeding.
Summary
The frontend client-side validation allows files up to 50MB, but the server enforces a hard 25MB ceiling. Users with files between 25–50MB get no warning on the frontend but receive a server error on submit.
Root Cause
Three misaligned values:
app.py:12—MAX_CONTENT_LENGTH = 25 * 1024 * 1024(Flask hard limit, request is rejected before reaching any route handler)backend/routes/uploads.py—/uploadand/previewboth hardcodeif file_size_mb > 25:frontend-vite/react-ts/src/components/labelUploader.tsx— bothhandleUploadandhandlePreviewuseconst maxSize = 50 * 1024 * 1024The
settings.pyconfig hasMAX_FILE_SIZE = 50MB(dev) /25MB(prod), but the route handlers ignore this config and hardcode 25MB directly.Impact
Users who select a file between 25–50MB will pass client-side validation but get a 413 error from the server with no clear explanation.
Fix Options
MAX_CONTENT_LENGTHinapp.py, both route handlers inuploads.py, andProductionConfig.MAX_FILE_SIZEinsettings.pyOption 2 requires verifying the hosting tier supports 50MB request bodies before proceeding.
Notes
/uploadhad the hardcoded 25MB check before preview was addedfile_size_mb > 25checks are redundant givenMAX_CONTENT_LENGTH, but serve as a friendlier error message