Sulu 3.x: Configuring a maximum upload size for chunked media uploads
0 reputation · 23 Aug 2020, 21:34 UTC
Sulu 3.x introduces chunked media uploads with a default 1 MB chunk size configurable via sulu_media.upload_chunk_size. However, the bundle offers no explicit setting to cap the overall file size. This can lead to large uploads that consume server resources, and the UI provides no built‑in cancellation or timeout handling.
The goal is to identify a clean, documented way to impose a per‑upload limit and expose a graceful cancellation mechanism. Constraints include preserving the existing chunked workflow, compatibility with PHP’s upload_max_filesize and post_max_size, and ensuring orphaned temporary files are cleaned up promptly.
Unresolved questions:
- How can we add a configurable maximum upload size to Sulu’s media bundle without breaking existing uploads?
- What API or event could be leveraged to abort a chunked upload and remove all partial files immediately?
- Are there best practices for setting per‑request timeouts that work across Sulu 3.x and Symfony 6?