Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Performs a basic Excel API call using plain JavaScript & Promises.
name: FileSaver minimal test
description: Performs a basic Excel API call using plain JavaScript & Promises.
host: EXCEL
api_set: {}
script:
content: |-
const blob = new Blob(["test"], { type: "application/octet-stream" });
const reader = new FileReader();
reader.onloadend = function () {
const url = reader.result.replace(/^data:[^;]*;/, 'data:attachment/file;');
location.href = url
}
reader.readAsDataURL(blob)
language: typescript
template:
content: ''
language: html
style:
content: ''
language: css
libraries: file-saver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.