codemelted.js Module
    Preparing search index...

    Function disk_write_file

    • Will save the specified data to a filename in the operating system download directory.

      Parameters

      • params: { data: string | ArrayBuffer | Uint8Array<ArrayBufferLike>; filename: string }

        The named parameters.

        • data: string | ArrayBuffer | Uint8Array<ArrayBufferLike>

          The data to write to disk.

        • filename: string

          What to call the file in the download directory.

      Returns Promise<CResult<void>>

      The result of the save. A rejected promise represents an API violation.

      // Go attempt to download the file contents from a blob
      let result = await disk_write_file({
      data: image_blob,
      filename: "picture_of_me.png"
      });
      if (result.is_error()) {
      // handle the error
      }