Problem Statement
There is no way to hook into the upload process for logging, virus scanning, custom validation, or post-upload processing. Users must implement these concerns outside the uploader.
Proposed Solution
Add callback support:
onBeforeUpload(callable $callback) — called before each file is moved, receives file info array. Return false to reject.
onAfterUpload(callable $callback) — called after each successful upload, receives the UploadedFile object.
Alternatives Considered
- Event-based system (overkill for this library)
- Subclassing with protected hook methods
Breaking Change
No
Problem Statement
There is no way to hook into the upload process for logging, virus scanning, custom validation, or post-upload processing. Users must implement these concerns outside the uploader.
Proposed Solution
Add callback support:
onBeforeUpload(callable $callback)— called before each file is moved, receives file info array. Return false to reject.onAfterUpload(callable $callback)— called after each successful upload, receives theUploadedFileobject.Alternatives Considered
Breaking Change
No