title: Flutter web - how to save excel file to the device
body: <p>I have a problem with saving data to the device.
  I have base64 String that I need to save to the device as an excel file.
  Everything happens on web.
  All I found so far are mobile solutions that doesn't work.</p>
  <p>Could you please help :)</p>
  <p>This is the code that I have currently. It saves the file, however it I can't open it afterwards so there has to be something wrong on the way. Since this solution writes the file I'm guessing I'm converting something wrongly.</p>
  <pre><code>    //base64StringFile is the file I'm getting from the web. It's a String
      Uint8List bytes = base64.decode(base64StringFile);
      File file = File.fromRawPath(bytes);
  
      final blob = html.Blob([file]);
      final url = html.Url.createObjectUrlFromBlob(blob);
      final anchor = html.document.createElement('a') as html.AnchorElement
        ..href = url
        ..style.display = 'none'
        ..download = 'myFileName';
      html.document.body.children.add(anchor);
  
      anchor.click();
  
      html.document.body.children.remove(anchor);
      html.Url.revokeObjectUrl(url);
  </code></pre>