eligrey / eligrey/FileSaver.js

html 导出来 word 文件在微信中打不开,提示文件已损坏, 直接在电脑上下载可以打开

Open
#716 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22k
Forks
4.3k
PR merge metrics
No merged PRs in 30d

Description

gTranslate: The word file exported from html cannot be opened in WeChat, indicating that the file is corrupted, and it can be opened by downloading it directly on the computer

```js
const fileContent = mhtml.top.replace(
"_html_",
mhtml.head.replace() + mhtml.body.replace("_body_", document.querySelector('#myMessage').innerHTML),
)
const blob = new Blob([fileContent], {
type: "application/msword;charset=utf-8",
})

saveAs(blob, title)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.