Skip to content

Commit

Permalink
Add correct docx mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
dolanmiu committed Dec 10, 2018
1 parent f640f17 commit e5bfa99
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/export/packer/packer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,30 @@ export class Packer {

public async toBuffer(file: File): Promise<Buffer> {
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<string> {
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<Blob> {
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;
}
Expand Down

0 comments on commit e5bfa99

Please sign in to comment.