mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
dropme: debug download
This commit is contained in:
parent
8e61b161ec
commit
eb2ea0092c
|
@ -159,19 +159,25 @@
|
|||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const binary = "{{{responseBinary}}}" ? JSON.parse(decodeURIComponent("{{{responseBinary}}}")) : '';
|
||||
console.log('dgl binary', binary);
|
||||
|
||||
if (binary) {
|
||||
const decodedBinary = atob(binary.data);
|
||||
console.log('dgl decodedBinary', decodedBinary);
|
||||
|
||||
const blob = new Blob([decodedBinary], {
|
||||
fileExtension: binary.fileExtension ?? "",
|
||||
fileName: binary.fileName ?? "",
|
||||
type: binary.mimeType ?? "",
|
||||
});
|
||||
console.log('dgl blob', blob);
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = binary.fileName ?? "file";
|
||||
document.body.appendChild(link);
|
||||
console.log('dgl link', link);
|
||||
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue