title: Force download for blob created with FileWriter in JavaScript
body: <p>HTML5 introduces the FileWriter class. With this class you can make Blobs. (A File is an extension of a Blob.) With JavaScript you can make a Blob and for instance show it using the dataURL.</p>
  
  <p>Example:</p>
  
  <pre><code>var bb = new BlobBuilder();
  bb.append('some text')
  var blob = bb.getBlob('text/plain');
  
  var fr = new FileReader();
  fr.onload = function(e) {
   document.location = this.result; // voila the dataURL
  }
  fr.readAsDataURL(blob);
  </code></pre>
  
  <p>But that's not good enough :) I want the newly created (text) file to be downloaded. Not opened in the same or a separate window.</p>
  
  <p>Is there a way? There must be. How?</p>
  
  <p>(The discussion already exists in the <a href="http://groups.google.com/a/chromium.org/group/chromium-html5/msg/d98e0f6454585368?hl=en" rel="nofollow">Google Chrome group</a>)</p>
  
  <p><strong>UPDATE</strong><br>
  The File API has changed, because the specs have changed (or something!?). Webkit broke backward compatibility with <code>BlobBuilder</code>, now called <code>WebKitBlobBuilder</code>. <a href="http://jsfiddle.net/rudiedirkx/79JrG/" rel="nofollow">Same example differently on jsFiddle</a></p>
  
  <p><strong>UPDATE</strong><br>
  Creating Blobs now works differently again (no more <code>append()</code>):</p>
  
  <pre><code>blob = new Blob(['some text'], {type: 'text/plain'});
  </code></pre>