Topic: Default file for 'drag and drop' plugin
KES
free
asked 11 months 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 11 months 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
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: 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