set the mime type in the download blob

This commit is contained in:
Danny Coates 2017-08-09 12:56:32 -07:00
parent 626e578acb
commit 193664a8e8
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
5 changed files with 40 additions and 24 deletions

View file

@ -57,7 +57,8 @@ function download() {
}
throw err;
})
.then(([decrypted, fname]) => {
.then(([decrypted, file]) => {
const fname = file.name;
const endTime = Date.now();
const time = endTime - startTime;
const downloadTime = endTime - downloadEnd;
@ -73,7 +74,7 @@ function download() {
});
const dataView = new DataView(decrypted);
const blob = new Blob([dataView]);
const blob = new Blob([dataView], { type: file.type });
const downloadUrl = URL.createObjectURL(blob);
const a = document.createElement('a');