title: How download Excel file in Vue.js application correctly?
body: <p>I'm struggling to download an <code>Excel</code> file in <code>xlsx</code> format in my <code>Vue.js</code> application. My Vue.js application make post request to the Node.js application which download that Excel file from remote SFTP server. Backend application works without any problems. </p>
  
  <p>In Vue.js application I use next code:</p>
  
  <pre class="lang-js prettyprint-override"><code>axios.post(config.backendHost + '/excel', {
    file_name: fileName
  }).then((response) =&gt; {
    const url = URL.createObjectURL(new Blob([response.data], {
      type: 'application/vnd.ms-excel'
    }))
    const link = document.createElement('a')
    link.href = url
    link.setAttribute('download', fileName)
    document.body.appendChild(link)
    link.click()
  });
  </code></pre>
  
  
  
  <p>After downloading file by browser, file opens automatically and I am experiencing an error that looks like this:</p>
  
  <blockquote>
    <p>We found a problem with some content <code>.xlsx</code>. Do you want us to try and recover as much as we can?</p>
  </blockquote>