nextcloud+onlyoffice 打开wps方法,亲测方案。

本人测试的onlyoffice为7.1.1社区版。修改onlyoffice文件api.js。

1、在api.js中找到下段代码

var type = /^(?:(xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb)|(pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|oxps|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform|docxf))$/

2、分别加入对应word文件wps,excel文件et,PowerPoint文件dps

var type = /^(?:(et|xls|xlsx|ods|csv|xlst|xlsy|gsheet|xlsm|xlt|xltm|xltx|fods|ots|xlsb)|(dps|pps|ppsx|ppt|pptx|odp|pptt|ppty|gslides|pot|potm|potx|ppsm|pptm|fodp|otp)|(wps|doc|docx|doct|odt|gdoc|txt|rtf|pdf|mht|htm|html|epub|djvu|xps|oxps|docm|dot|dotm|dotx|fodt|ott|fb2|xml|oform|docxf))$/

3、通过7Z压缩软件把api.js压缩为api.js.gz

4、修改文件nextcloud文件appconfig.php

docker文件路径:/var/www/html/custom_apps/onlyoffice/lib/appconfig.php
修改下面这一条(这条是为了可以在线编辑doc文件,但另外需要重编译onlyoffice,想见下文)

"doc" => [ "mime" => "application/msword", "type" => "word","edit" => true, "conv" => true, "saveas" => ["docx", "odt", "pdf", "rtf", "txt"] ],

新增下面三条

"wps" => [ "mime" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "type" => "word", "edit" => true, "def" => true, "review" => true, "comment" => true, "saveas" => ["odt", "pdf", "rtf", "txt", "docxf"] ],
"dps" => [ "mime" => "application/vnd.openxmlformats-officedocument.presentationml.presentation", "type" => "slide", "edit" => true, "def" => true, "comment" => true, "saveas" => ["pdf", "odp"] ],
"et" => [ "mime" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "type" => "cell", "edit" => true, "def" => true, "comment" => true, "modifyFilter" => true, "saveas" => ["csv", "ods", "pdf"] ],


6、docker文件路径:/var/www/html/resources/config/mimetypemapping.dist.json
新增下面三条

"et": ["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],
"dps": ["application/vnd.openxmlformats-officedocument.presentationml.presentation"],
"wps": ["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],

这样就可以在nextcloud中通过onlyoffice在线浏览wps、et、dps文件,但编辑后不能保存,这是因为onlyoffie默认不支持。如有需要可私信定制二次开发,也可以下载本人编译好的基础版docker离线镜像。

https://download.csdn.net/download/zjnhgjwb/85561790

eb5d77d6ff7b41908ab12bdd784a100b.jpeg

493df1277b6d4589b7d339f590582df9.jpeg

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zjjx-hope

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值