Skip to content

feat(FileUploader): Add upload callback hooks for logging and validation #53

@usernane

Description

@usernane

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions