The front-to-back jar package failed:
Save to local management machine jar package md5sum upload the correct value md5sum value is not equal. and upload processing without errors, indicating errors during the save process:
The front is Base64 then transcoding the contents of the jar package into the request.body[reqtype] inside:
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 () decoding using Base64 is also removed:
varnew‘base64‘);try { //保存jar包到本地管理机catch(err){ console.log("this is error"); return;}
Nodejs Saving a file