From e5bfa99b922b0c9b5dbd530cc3d8b063da05682b Mon Sep 17 00:00:00 2001 From: Dolan Date: Mon, 12 Nov 2018 12:32:07 +0000 Subject: [PATCH 1/2] Add correct docx mime type --- src/export/packer/packer.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/export/packer/packer.ts b/src/export/packer/packer.ts index e85b42c8ea..856f74b59e 100644 --- a/src/export/packer/packer.ts +++ b/src/export/packer/packer.ts @@ -10,21 +10,30 @@ export class Packer { public async toBuffer(file: File): Promise { const zip = await this.compiler.compile(file); - const zipData = (await zip.generateAsync({ type: "nodebuffer" })) as Buffer; + const zipData = (await zip.generateAsync({ + type: "nodebuffer", + mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + })) as Buffer; return zipData; } public async toBase64String(file: File): Promise { const zip = await this.compiler.compile(file); - const zipData = (await zip.generateAsync({ type: "base64" })) as string; + const zipData = (await zip.generateAsync({ + type: "base64", + mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + })) as string; return zipData; } public async toBlob(file: File): Promise { const zip = await this.compiler.compile(file); - const zipData = (await zip.generateAsync({ type: "blob" })) as Blob; + const zipData = (await zip.generateAsync({ + type: "blob", + mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + })) as Blob; return zipData; } From 3a1a21e498ee4b4995cb44acaab18ab36f3234eb Mon Sep 17 00:00:00 2001 From: Dolan Date: Mon, 10 Dec 2018 19:27:51 +0000 Subject: [PATCH 2/2] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a915ac383d..cd12e5ffdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docx", - "version": "4.4.0", + "version": "4.4.1", "description": "Generate .docx documents with JavaScript (formerly Office-Clippy)", "main": "build/index.js", "scripts": {