title: Setting filename using encodeURIComponent() to let user download data file
body: <p>Alright, so I have this webpage page that gets its data using AJAX requests (in javascript using JQuery). Once the data has been loaded on to the users browser I want to let them download said data without having to request it from the server again.</p>
  
  <p>To do this, I found this little bit of code (in Javascript):</p>
  
  <pre><code>window.location = 'data:text/csv;charset=utf8,' + encodeURIComponent(someCSVtext);
  </code></pre>
  
  <p>This does what I want it to do, but it always names the file "download.csv"</p>
  
  <p>Is there a way I can preset the filename assuming the user has an "always download file" option set in their browser (thus don't get a chance to rename the file)?</p>