Const
Save a blob to disk.
Goes through downloadBlob, so the download also works inside the Tauri webview, where <a download> is silently dropped. Blob only: a URL would have to fall back to that anchor, and a caller has no way to notice it did nothing.
<a download>
const download = useFileDownload();const handleDownload = (data: string) => { download(new Blob([data], { type: 'text/plain' }), 'test.txt');}; Copy
const download = useFileDownload();const handleDownload = (data: string) => { download(new Blob([data], { type: 'text/plain' }), 'test.txt');};
Save a blob to disk.
Goes through downloadBlob, so the download also works inside the Tauri webview, where
<a download>is silently dropped. Blob only: a URL would have to fall back to that anchor, and a caller has no way to notice it did nothing.