Problem Statement
FileUploader reads upload_max_filesize from PHP config but doesn't let you set a custom per-uploader size limit. Applications often need different size limits for different upload contexts (e.g., avatar images vs document uploads).
Proposed Solution
Add setMaxFileSize(int $sizeInBytes) and getMaxFileSizeLimit() methods. During upload, reject files exceeding the custom limit with a descriptive error.
Alternatives Considered
- Only relying on PHP's ini setting (insufficient for per-context limits)
Breaking Change
No
Problem Statement
FileUploaderreadsupload_max_filesizefrom PHP config but doesn't let you set a custom per-uploader size limit. Applications often need different size limits for different upload contexts (e.g., avatar images vs document uploads).Proposed Solution
Add
setMaxFileSize(int $sizeInBytes)andgetMaxFileSizeLimit()methods. During upload, reject files exceeding the custom limit with a descriptive error.Alternatives Considered
Breaking Change
No