doo.functions.browser

Wrapper for browser functionality.

Download file

Calls download file dialog in the browser.

Parameters

  • content (string, byte array, Blob)
  • file name
  • mime type
  • charset

Examples

// plain text
doo.functions.browser.saveFile('my text', 'filename plain.txt');
// base64
doo.functions.browser.saveFile(btoa('my text'), 'filename 64.txt', 'text/plain', 'base64');

// bytes
const utf8EncodeText = new TextEncoder();
const byteArray = utf8EncodeText.encode('my text');
doo.functions.browser.saveFile(byteArray, 'filename ab.txt');