Topic: Default file for 'drag and drop' plugin

KES free asked 2 years ago

Expected behavior Hi! I use 'drag and drop' plugin. In example there is used an 'url' to set default image

Actual behavior I need use downloaded file like with src in <img>

Example: let src = 'data:image/jpeg;base64,' +myfile; FileUpload.getInstance( uploaded ).update({ defaultFile: src, });

How can I do this way correctly? Resources (screenshots, code snippets etc.)

Michał Duszak staff answered 2 years ago

Hello, actually everything you pass into the defaultFile option eventually ends up as the src attribute in an <img> element. You can load local files using webpack for example, see docs on asset management for webpack:

It could be very easy to set up with our webpack starter:

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 3.8.1
  • Device: computer
  • Browser: firefox
  • OS: linux
  • Provided sample code: Yes
  • Provided link: No