Hello and thank you for a great component!
Is there an easy way of converting the files passed to the onDrop event to base64?
Thank you
Just convert to whatever you want in the onDrop callback. It gets the files object from the browser. See https://github.com/okonet/react-dropzone/blob/master/src/index.js#L98
Maybe this example might help:
onDropHandler(files) {
var file = files[0]
const reader = new FileReader();
reader.onload = (event) => {
console.log(event.target.result);
};
reader.readAsDataURL(file);
}
Maybe this example might help:
onDropHandler(files) { var file = files[0] const reader = new FileReader(); reader.onload = (event) => { console.log(event.target.result); }; reader.readAsDataURL(file); }You are simply awesome buddy!!!!!
Most helpful comment
Maybe this example might help: