Extracted some pages to their own assembly and finished the artifact display page code
This commit is contained in:
12
OpenArchival.Blazor/wwwroot/js/downloadHelper.js
Normal file
12
OpenArchival.Blazor/wwwroot/js/downloadHelper.js
Normal file
@@ -0,0 +1,12 @@
|
||||
function downloadFileFromBytes(fileName, mimeType, bytesBase64) {
|
||||
const link = document.createElement('a');
|
||||
link.href = `data:${mimeType};base64,${bytesBase64}`;
|
||||
link.download = fileName;
|
||||
|
||||
// This is required for Firefox
|
||||
document.body.appendChild(link);
|
||||
|
||||
link.click();
|
||||
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
Reference in New Issue
Block a user