You've already forked isop-mirror
feat: update triggerDownload function to accept file extension parameter
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
export function triggerDownload(file: Blob, file_name: string) {
|
||||
export function triggerDownload(file: Blob, file_name: string, ext: string) {
|
||||
const url = window.URL.createObjectURL(file);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = `${file_name}.pdf`;
|
||||
link.download = `${file_name}.${ext}`;
|
||||
link.target = "_blank";
|
||||
link.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
Reference in New Issue
Block a user