Add File Limit Validation to S3 Multi Upload Component

Requested Feature:
The App Connect S3 Multi Upload component should include a property to enforce a maximum number of selectable files.

Summary:
The current dmx-s3-upload-multi component allows a user to select an unlimited number of files from their file browser. While individual files can be removed from the queue in the UI, there is no built-in mechanism to prevent the user from selecting more than a specified limit in the first place.

Furthermore, because the component's url property is executed once for each selected file, there is no single server-side entry point to validate the total file count before the upload process begins. This makes it impossible to enforce a limit on the server side in a user-friendly way.

This feature request is to add a client-side validation property directly to the component to solve this problem.

Benefits of this Feature:

  1. Improved User Experience: It provides immediate, client-side feedback to the user, preventing them from selecting too many files and having to manually correct the queue. This is a much better experience than receiving an error after the upload process has already begun.

  2. Enables Business Logic: It allows developers to enforce business rules and plan tiers (e.g., "Free users can upload 3 files, Pro users can upload 10").

  3. Reduces Server Load: It prevents unnecessary server-side calls to the S3 Signed Upload Url action for files that would ultimately be rejected, saving server resources.

  4. Completes the Component's Feature Set: File count validation is a standard and essential feature for any multi-file uploader, and its inclusion would make the S3 Multi Upload component a more complete and robust tool.

This feature would provide a much-needed layer of control and validation for a very common use case, improving both the developer and the end-user experience.

I will add a simple maxfiles option, the option will only limit the number of files that can be added in the control and is client-side only. Users could bypass this limit when they adjust the code using devtools.

Currently there is no validation error message or any event if validation fails. When a file is from a wrong filetype it is simply ignored and not added to the collection. We probably need an invalid event or some other feedback if files are not added due to a validation error.

If you want a more secure way to limit the files that are being uploaded, then you have to upload them first to your own server (for example with a serverconnect form and dropzone) and have client-side and server-side validation. In the server action you then upload them to the S3 endpoint. This however has as disadvantage that your server gets extra bandwidth and needs to store the files temporary.

Thank you @patrick. Having a maxfiles option is a start and I understand your explanation about a user being able to defeat this approach. I think the behavior to ignore any wrong filetype is also ok for the time being, at least for my use case.

I believe the S3 components the team has provided is a valuable feature of Wappler, and perhaps it will mature in the right directions with feedback from the community.

Added in Wappler 7.3.2