title: HTML5 input download (client only) seems to be limited by size
body: <p>I want to download a file (client only) which contains a stringified JSON object. For months everything went well until I needed to stringify a big json object.</p>
  
  <p>The text file is always created but the JSON object is simply cut off(if I change the json object it is cut off in different places).</p>
  
  <p>I checked and the whole JSON object is correctly stringified and put into the href attribute but it is not totally present in the downloaded text file.</p>
  
  <pre><code>const file = document.createElement('a');
              file.setAttribute('href', 'data:text/plain;charset=utf-8,' + JSON.stringify(jsonObj));
              file.setAttribute('id', 'tcDownload');
              file.setAttribute('download', fileName);
              file.style.display = 'none';
              document.body.appendChild(file);
  
              file.click();
              document.body.removeChild(file);
  
  </code></pre>
  
  <p>So I am wondering if where is some sort of size restriction while using client based downloading.</p>
  
  <p>Works fine now thank you:  epascarello </p>
  
  <p>SOLUTION:</p>
  
  <pre><code>const str = JSON.stringify(tc);
  var blob = new Blob(str.split(''), {type: 'text/plain'});
  const file = document.createElement('a');
  file.download = 'myFile.txt';
  file.href = URL.createObjectURL(blob);
  
  document.body.appendChild(file);
  file.click();
  
  </code></pre>