is there a way to directly retrieve the file encoded with base64? or convert it on the fly?
I have the same promble. @CarlosUvaSilva do you save it ?
@chenfengyanyu
onDropGeneral = (currentGeneralPhoto) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = (event) => {
this.setState({
generalPhotos: this.state.generalPhotos.concat([{ base64: event.target.result }])
});
};
}
}
@CarlosUvaSilva Thank you very much, i got it!
hey how can i use base 64 in my code for integration that function
@ndiyansah I've posted my solution on top. That last part saves the base64 in an array because I had more than one dropzones. If you only have one you can remove the concat and it will save it has a simple string
Most helpful comment
@chenfengyanyu