Skip to content

[Bug] Max file exceeds error message not showing #291

@viveknath3222

Description

@viveknath3222

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated Vue FilePond, FilePond, and all plugins?

  • I have updated FilePond and its plugins

Describe the bug

inputElement5.forEach(input => {
        FilePond.create(input, {
            acceptedFileTypes: ['image/jpeg', 'image/jpg', 'image/png', 'image/webp'],
                maxFileSize: '5MB',
                allowMultiple: true,
                maxFiles: 2,
                labelIdle: `Drag & Drop your files or <span class="filepond--label-action">Browse</span><br><small class="pond_label">Only .jpg and .png files are allowed (Max 5MB)</small>`,
                onwarning: (error, file, status) => {
                    if (error.body === 'You have reached the maximum allowed files') {
                        alert('You can only upload a maximum of 2 files.');
                    }
                }
        });
       

    });
Above is my image upload instance. I set max files to 2 and if I try to drag and drop 3 image files nothing is showing. 
How can I show an error message if I try to add more than 2 images?

Reproduction

inputElement5.forEach(input => {
        FilePond.create(input, {
            acceptedFileTypes: ['image/jpeg', 'image/jpg', 'image/png', 'image/webp'],
                maxFileSize: '5MB',
                allowMultiple: true,
                maxFiles: 2,
                labelIdle: `Drag & Drop your files or <span class="filepond--label-action">Browse</span><br><small class="pond_label">Only .jpg and .png files are allowed (Max 5MB)</small>`,
                onwarning: (error, file, status) => {
                    if (error.body === 'You have reached the maximum allowed files') {
                        alert('You can only upload a maximum of 2 files.');
                    }
                }
        });
       

    });

Environment

- Device:
- OS:
- Broser:
- Vue version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions