title: How to upload newly created jsPdf file to server instead of saving it in local computer?
body: <p>I am using html2canvas to create picture and jsPdf to create a pdf file. I want to upload this newly created file to the server instead of saving it to the local directory. Every time when I upload the file, it only uploads its name, not file.</p>
  
  <p>On line no. 7 of the code, I also tried <code>formData.append("file", photo+'.jpg');</code> but nothing happens.</p>
  
  <pre><code>    html2canvas(document.body).then(function(canvas) {
        var pageData = canvas.toDataURL('image/jpeg', 1.0);
        var pdf = new jsPDF('', 'pt', 'a4');\
        let photo = pdf.addImage(pageData, 'JPEG', 0, 0, 595.28, 592.28/canvas.width * canvas.height );
  
        let req = new XMLHttpRequest();
        let formData = new FormData();
  
        formData.append("file", photo);                                
        req.open("POST", '/image/file');
        req.send(formData);
  
      });
  </code></pre>
  
  <p>No error shows, it uploads but the name of the file NOT the file.</p>