title: Base64 encode/decode and download content generated in URL
body: <p>I am generating a string through JavaScript and I need to download it to a text file with a predefined dynamic filename. This way there will be no room for error by employees.</p>
  
  <p>This is obviously not possible in JavaScript due to security issues. However, from what I have read it should be possible with base64 encoding. </p>
  
  <p>I managed to encode the string and open a url with the decoded data. The string has been decoded successfully in this URL. The format is as follows:</p>
  
  <pre><code>var data = 'data:text/plain;base64,'+L_EncodedData;
  document.location = data;
  </code></pre>
  
  <p>I need to open a file dialog with the decoded data so the employees can download the content generated in this URL.</p>
  
  <p>Any help?</p>
  
  <p>Many thanks in advance</p>