We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 009f890 commit 577a233Copy full SHA for 577a233
src/main.ts
@@ -13,9 +13,14 @@ if (input) input.onchange = async (e: Event) => {
13
const file = element.files[0];
14
const compressedFile = await compressFile(file);
15
const dataURI = await getBase64Image(compressedFile);
16
+ const fullName = file.name;
17
+ const fullNameArray = fullName.split('.');
18
+ const extension = fullNameArray.pop();
19
+ const fileName = fullNameArray.join('.');
20
downloadElement.href = dataURI;
21
statusElement.style.display = 'none';
22
downloadElement.style.display = '';
23
+ downloadElement.download = `${fileName}-min.${extension}`;
24
}
25
26
let quality = 1;
0 commit comments