I need to upload an image to google drive via nodejs after cropping it by a image cropping library. Previously I was uploading images with file input field, so i can get buffer(using express-fileupload library) of the image in backend(nodejs). Now the problem is, after cropping I have image in the form of
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAA....
How to send images in this form to backend such that we could get buffer of that image so as to upload to google drive. Else could we upload this directly to google drive in frontend(javascript)? .I tried using FormData but I can get only string not buffer.
Copyright Notice:Content Author:「karthi keyan」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/74446207/uploading-image-to-google-drive-without-file-input-field