-
-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
Labels
bugSomething isn't workingSomething isn't working