Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
viveknath3222 opened this issue May 23, 2024 · 1 comment
Open
2 tasks done

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

viveknath3222 opened this issue May 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@viveknath3222
Copy link

viveknath3222 commented May 23, 2024

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:
@viveknath3222 viveknath3222 added the bug Something isn't working label May 23, 2024
@rikschennink
Copy link
Collaborator

It's possible you have to set dropValidation to true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants