title: Upload File Api request works in postman but not in nodejs and react MERN
body: <p>I am making file upload and media API, in Postman works ok but in code not </p>
  
  <p>React Code:</p>
  
  <pre><code>campaignChangedHandler = (event) =&gt; {
     this.setState(
          {
              campaignFile: document.getElementById('campaignFile').files[0]
          })
  };
  
  onSubmit = async(e) =&gt; {
     let formData = new FormData();
      formData.append('campaignFile', this.state.campaignFile);
  
       const headers = {
          'Authorization': `Bearer ${token}`
       };
  
        await axios.post('http://localhost:3001/upload/', {formData}, {headers}).then(resp =&gt; {
           console.log(resp)
        })
  };
  
  
  render() {
    return (
      &lt;form onSubmit={this.onSubmit}&gt;
          &lt;input value={this.state.data} error={errors.data}
              onChange={this.campaignChangedHandler}
              name={"campaignFile"}
              id="campaignFile"
              type="file"/&gt;
      &lt;/form&gt;
    )
  }
  </code></pre>
  
  <p>NODE JS code: </p>
  
  <pre><code>const fileUpload = require('express-fileupload');
  app.use(fileUpload());
  
  app.post('/upload', function (req, res) {
     console.log(req.files);
  }
  </code></pre>
  
  <p>I always get UNDEFINED in Nodejs console, I tried with multiparty, multer, busboy, but I get the same result, however in postman i get this:</p>
  
  <p><a href="https://i.stack.imgur.com/NhkQk.png" rel="nofollow noreferrer">response from postman</a></p>