Can't add multiple files one at a time to file-upload plugin


Topic: Can't add multiple files one at a time to file-upload plugin

DashMarketingGroup pro premium priority asked a year ago

I have noticed that even when the file-upload plugin is configured to let the user upload multiple files, they have to add the multiple files all at once. There may be cases when people want to upload multiple image files, but those files are not all in the same folder. In that case, they have to add each file separately, but the file-upload plugin doesn't allow for this. Once an image is added, you can only delete or replace it. In other words, after I add the first image, I can't add any more. All I can do is replace the one already there. Are there any settings I am missing that would help me understand this, or is this just how the plugin is designed?


kpienkowska staff answered a year ago

You can drag into file upload more files after the first one is added or click and add more. The message in the example in the documentation may be confusing so I've prepared another example: https://mdbootstrap.com/snippets/standard/kpienkowska/5560185


aztecadmin pro premium priority commented a year ago

They show up in the file upload box but when you call the files via javascript from the input only the first file is available via element.files


Kamila Pieńkowska staff commented a year ago

That is why we provide an event that allows you to access all files: fileUpload.addEventListener('fileAdd.mdb.fileUpload', (e) => { const addedFile = e.files; })


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.1
  • Device: laptop
  • Browser: chrome
  • OS: win11
  • Provided sample code: No
  • Provided link: No