Topic: Default file for 'drag and drop' plugin
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 3 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
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: No
- Provided link: No