title: How to create file in the local fs using modern FileApi?
body: <p>I have this code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>document.querySelector('#myfile').onchange = function(e) {
    var files = this.files;
    window.requestFileSystem(window.TEMPORARY, 1024 * 1024, function(fs) {
      let file = files[0];
      let nem_file_name = file.name + '_copy';
      fs.root.getFile(nem_file_name, {
        create: true,
        exclusive: true
      }, function(fileEntry) {
        fileEntry.createWriter(fileWriter =&gt; {
          fileWriter.write(file);
        }, () =&gt; alert('error 1'));
      }, err =&gt; alert('error 2 ' + err));
    }, () =&gt; alert('error 3'));
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="file" id="myfile" ref="myfile" multiple /&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I want to create a copy of my file when I select it with the input control. What's wrong with my code? I got no errors and nothing happens</p>