Triggers a file download in the browser.
Accepts either a Blob object or a string URL and downloads it with the specified filename.
Blob
The file data as a Blob or a string URL.
The desired name of the downloaded file.
// Download a text fileconst blob = new Blob(["Hello World"], { type: "text/plain" });downloadFile(blob, "hello.txt");// Download from a URLdownloadFile("https://example.com/file.pdf", "file.pdf"); Copy
// Download a text fileconst blob = new Blob(["Hello World"], { type: "text/plain" });downloadFile(blob, "hello.txt");// Download from a URLdownloadFile("https://example.com/file.pdf", "file.pdf");
1.1.0
Triggers a file download in the browser.
Accepts either a
Blob
object or a string URL and downloads it with the specified filename.