Upload images and attach as base64
Hey Guys I have a requirement to upload the images as base64. So instead of passing the images to an end point url they will be embedded as base64. Can someone pass me in the right direction
Thanks
For anyone else that's looking you can use this method on upload
https://github.com/editor-js/image#server-format
you can try
uploadByFile(file){ return _getBase64(file, function(e) {}).then((data)=>{ return { success: 1, file: { url: data } } }) }
declare function function _getBase64(file, onLoadCallback) { return new Promise(function(resolve, reject) { var reader = new FileReader(); reader.onload = function() { return resolve(reader.result ); }; reader.onerror = reject; reader.readAsDataURL(file); }); }