alexusmai / laravel-file-manager

File manager for Laravel
MIT License
1.13k stars 290 forks source link

FilesUploaded event is triggered even when uploading a file with an invalid format #388

Open mhgolij opened 3 months ago

mhgolij commented 3 months ago

Description: I have encountered an issue where the FilesUploaded event is still triggered even if an attempt is made to upload a file with an invalid format. Although the file is not uploaded, the event is incorrectly fired.

Steps to Reproduce:

Configure the package with specific allowed file formats in the config file.
Attempt to upload a file with an invalid format that is not allowed by the configuration.
Observe that the file is not uploaded, but the FilesUploaded event is triggered.

Expected Behavior: The FilesUploaded event should only be triggered when a file is uploaded successfully with a valid format. If the file format is invalid and the upload fails, the event should not be triggered.

Environment:

Laravel Version: 10
Package Version: 3.0
PHP Version:8.2