problem description
problems with uploading files using Multer in nodeJS
the environmental background of the problems and what methods you have tried
the front end receives a base64 string, organizes it into formData, and uses the append method to add it, and sends it to the backend for processing
the specific process and problems in which the backend cannot find req.files, are as follows:
related codes
/ / Please paste the code text below (do not replace the code with pictures)
the backend reads the picture and converts it into a base64 bit string, adds it to the object picBase64 and sends it to the front end. Key is the file name:
let data = fs.readFileSync(filedir);
data = new Buffer(data).toString("base64");
picBase64[filename]=data;
picBase64 printing of objects received by the front end :
base64formData,fromformData:
formData,req.files,originalFilename:
multer:
formData:
what result do you expect? What is the error message actually seen?
ask the boss to tell me why. Provide some solutions