title: Nodejs Formdata file upload
body: <p>I am getting my image object from canvas and converting it into blob and then to file in java script</p>
  
  <pre><code>        var sendingData = new FormData();
          var ctx = mainCanvas.getContext("2d");
          console.log("canveas content =" + noofchildren.get(i));
          ctx.drawImage(noofchildren.get(i), 0, 0, mainCanvas.width, mainCanvas.height);
  
          var b64Data = mainCanvas.toDataURL("image/jpeg", 0.7).split(",")[1];
          var byteCharacters = atob(b64Data);
          var byteNumbers = new Array(byteCharacters.length);
          for (var j = 0; j &lt; byteCharacters.length; j++) {
              byteNumbers[j] = byteCharacters.charCodeAt(j);
          }
          var byteArray = new Uint8Array(byteNumbers);
          var blob = new Blob([byteArray], { type: contentType });
          var file = new File([blob], "sample.JPG", { type: "image/jpeg" });
  
          sendingData.append(nameOfTheImageFiles[i], file);
  
          var ajaxRequest = $.ajax({
          type: "POST",
          url: "/api/" + email + "/imagesupload",
          contentType: 'multipart/form-data',
          processData: false,
          data: sendingData
      }).success(function (data) {
          console.log(data);
          $("#image-container").children().remove();
      });
  </code></pre>
  
  <p>i am using ajax to post my file to nodejs server</p>
  
  <p>and req.files is an empty object in nodejs</p>
  
  <p>How to resolve?</p>
  
  <p>In asp.net I am getting the file on post method</p>