MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / downloadFile

Function downloadFile

devtools/panel.bundle.js:173–189  ·  view source on GitHub ↗
(content, filename, mimeType)

Source from the content-addressed store, hash-verified

171 }
172
173 function downloadFile(content, filename, mimeType) {
174 const bom = mimeType === 'text/csv' ? '\uFEFF' : '';
175 const blob = new Blob([bom + content], { type: mimeType + ';charset=utf-8' });
176 const url = URL.createObjectURL(blob);
177
178 const a = document.createElement('a');
179 a.href = url;
180 a.download = filename;
181 a.style.display = 'none';
182 document.body.appendChild(a);
183 a.click();
184
185 setTimeout(() => {
186 document.body.removeChild(a);
187 URL.revokeObjectURL(url);
188 }, 100);
189 }
190
191 // Connection storage module - IndexedDB operations
192

Callers 3

exportToJSONFunction · 0.70
exportCurrentToCSVFunction · 0.70
exportAllToCSVFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected