title: Uploading a file using "fetch" in reactJS
body: <p>Uploading a file using "fetch" in reactjs</p>
  
  <p>I am trying to upload a file using ReactJS.</p>
  
  <pre><code>handleUploadfile = (event) =&gt; {
          event.preventDefault();
          const data = new FormData();
          data.append('photo',event.target.files[0] );
          data.append('name', 'Test Name');
          data.append('desc', 'Test description');
          fetch("http://localhost:3001/todo/upload", {
               method: 'POST',
               headers: {
                   'Accept': 'application/json',
                   'Content-Type': 'application/x-www-form-urlencoded'
               },
               body: data
          }).then((response) =&gt;  {
             return response.text();
          })
      }
  </code></pre>
  
  <p>For some reason I am not able read the files at nodejs(+multer) server using:</p>
  
  <p><code>req.files</code></p>
  
  <p>which shows "undefined" at post router.</p>