0

私はpeer.jsを使用してあるユーザーから別のユーザーにWord文書を送信しようとしていましたが、コンテンツを取得していないWord文書のどこでもテキストファイル(.txt、text/plain)を操作しても問題ありません。

これが私が今までやったことです

box.on('drop', function (e) {
            e.originalEvent.preventDefault();
            var file = e.originalEvent.dataTransfer.files[0];
            eachActiveConnection(function (c, $c) {
                if (c.label === 'file') {
                    if (file.type == "text/plain") {
                        alert("type : " + file.type + " - sendable");
                        c.send(file);
                    } else {
                        //here i need to convert word document into text/plain or atleast to string and send the file by using // c.send(file)

                    }
4

1 に答える 1

0

私は専門家ではありませんが、AFAIK docx ドキュメントは単純なプレーン テキストではない標準に従っています (RTF のように)。docx base64 文字列を HTML に変換することを約束するDOCX.jsにチャンスを与えたいと思います。

于 2015-07-02T10:14:37.837 に答える