Skip to content

Commit

Permalink
now file name has zip extensio but name not correct? Fixing soon
Browse files Browse the repository at this point in the history
  • Loading branch information
Khongchai committed Oct 4, 2024
1 parent afd00e5 commit 745e2b3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/client/lazy-app/Compress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -967,15 +967,16 @@ export default class Compress extends Component<Props, State> {
return await Promise.allSettled(jobs);
}

private downloadFromUrl(url: string) {
let a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('download', '');
a.setAttribute('target', '_blank');
private downloadFromUrl(url: string, fileName: string = 'download.zip') {
const a = document.createElement('a');
a.href = url;
a.download = fileName;
a.target = '_blank';
document.body.appendChild(a);
a.click();
a.remove();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}

/**
* Download all using settings from one of the two sides by
* queuing each image in succession.
Expand Down

0 comments on commit 745e2b3

Please sign in to comment.