Sincerely ask for advice, nodejs analyzes formdata

  node.js, question

I found all kinds of information on the internet and installed all kinds of bags mentioned by netizens, but it just couldn’t solve the problem.

Front end code

$.ajax({
 url:'/pass/uploadexcel',
 type:'POST',
 dataType:'json',
 data:data,
 contentType:false,
 success:this.uploadSuccess,
 processData: false,
 error:this.uploadError
 });

In this way, I submitted formdata data (just a file) to Nodejs at the back end, but the back end did not know what to use to parse it out.

Ask the great god for guidance

Data should be written like this when uploading files.

data:new FormData($('#form')[0])

Files can be used in express to obtain uploaded files.