title: how to save excel file converted to base64 in directory with xlsx?
body: <p>I am trying to save an excel file that I get from a post as base64, this conversion is done in my view, once I convert it, I try to save it with the xlsx library, this file is saving fine but when opening the file, it does not contain nothing. Can someone help me, in knowing what I am doing wrong?</p>
  <p>my following code is:</p>
  <pre><code>private async getCurp(req: Request, res: Response) {
  
  var datos = [];
  let arrayusers = {};
  const {
    curp
  } = req.body;
  
  const newCurp = new CurpModel({
    curp
  });
  const path = &quot;C:\\Miroute&quot;
  var bufferFile = Buffer.from(curp, &quot;base64&quot;);
  const data = XLSX.read(bufferFile, { type: 'buffer' })
  XLSX.writeFile(data, &quot;excel.xls&quot;);
  try {
    return Ok&lt;CurpType&gt;(res, newCurp);
  }
  catch (error) {
    console.log(error);
    return ServerError(res);
  }
  </code></pre>
  <p>In my component I convert my excel file to base64 in this way, iam using react</p>
  <pre><code>    handleFileChange = e =&gt; {
      let idCardBase64 = '';
      this.getBase64(e.target.files[0], (result) =&gt; {
           idCardBase64 = result;
          console.log(idCardBase64)
           this.setState({
              file: idCardBase64,
            })
           
      });
    }
  
    getBase64(file, cb) {
      let reader = new FileReader();
      reader.readAsDataURL(file);
      reader.onload = function () {
          cb(reader.result)
      };
      reader.onerror = function (error) {
          console.log('Error: ', error);
      };
  }
  </code></pre>
  <p>Please can someone help me?</p>