Is there a way to merge all file rejected events to one?

Having set some file constraints like max file size or max file count per upload (Upload compoent), a file rejected event is fired for every file, which do not meed conditions.

documentsUpload.addFileRejectedListener(new DefaultUploadFileRejectedListener());

For example, if i set max file count to 5 and I try to upload 8 files, a file rejected event is fired 3 times. Potencially showing multiple redundant notifications.

Docs:

There’s no built-in feature for anything like that. I guess you could to it manually e.g. by keeping track of a timestamp for the last even and ignoring any following event if they come too frequently.

1 Like