There was a problem with the jar package that I got from the front end:
The md5sum value of the jar package saved to the local management machine is not equal to the correct md5sum value of the upload, and there is no error in the upload process, indicating an error during the save process:
The front end is Base64 transcoding and then putting the contents of the jar into the Request.body[reqtype]:
First the error code:
First decode with Base64:
newBuffer(request.body‘base64‘).toString();
Then use WriteFile's Async method to write to the file:
//保存jar包到本地管理机
=====================================================
Discover the problem:
Nodejs asynchronous write to the file cause the file has not finished writing back, should be changed to synchronous Writefilesync, first write the file and then return. and the ToString () with Base64 decoding is also removed:
varnew‘base64‘);try { //保存jar包到本地管理机catch(err){ console.log("this is error"); return;}
Nodejs Saving file problems