【发布时间】:2018-01-27 23:46:44
【问题描述】:
用户可以上传他们的ms word文件,其中的文本应该显示在另一个页面上。我的 html 和 javascript(vuejs) 是这样的:
HTML
<form>
<input type='file' v-on:click='retrieve'>
</form>
JS
retrieve: function retrieve(e) {
var asfarasicansee = e.target.files[0]
console.log(asfarasicansee)
这将返回一些文件信息,如获取信息段落中所述:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
我能找到的唯一其他东西是 2001 年的这个,它只适用于 Internet Explorer,但我的其他代码在 Internet Explorer 中不起作用: https://snook.ca/archives/javascript/copying_from_mi
有谁知道如何使用 MS word(或任何其他文本编辑器)文件?如何从此类文档中检索文本?
【问题讨论】: