title: Download a file using fetch api
body: <p>I am trying to download a file by clicking on a button it doesn't download the file. Although, if I go to the url on my browser then the <strong>docx</strong> is downloaded.</p>
  
  <p>Fetch request:</p>
  
  <pre><code>const response = await fetch(`/template/${id}/docx`, {
    method: 'GET',
    credentials: 'include',
  });
  
  const blob = await response.blob();
  
  const file = new File([blob], id, {type: blob.type, lastModified: Date.now()});
  </code></pre>
  
  <p>Response:</p>
  
  <p><a href="https://i.stack.imgur.com/pCNAF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pCNAF.png" alt="enter image description here"></a></p>