For help, how to convert base64 into a picture, upload it to the local area with node, and show it at the front desk?

  node.js, question

Problem description: pc side takes photos to obtain base64 file, wants to upload this file to local node service, and reads the photographed file when querying

var formData = new FormData();
 var btn = document.getElementById("uploadImg");  //upload control
 var file = btn.files[0];
 formData.append('file',file);  //This formData is submitted to the background
 var reader = new FileReader();  //
 reader.onloadend = function () {
 var dataURL = reader.result;
 var img = new Image();
 img.src = dataURL;  This can be replaced after the foreground preview is successful.
 //Insert into DOM for preview
 //   ...
 };
 reader.readAsDataURL(file);