Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


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: https://webpack.js.org/guides/asset-management/#loading-images

It could be very easy to set up with our webpack starter: https://github.com/mdbootstrap/mdb-webpack-starter



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

  • 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