kkfileview 在线预览
码云下载地址:https://gitee.com/kekingcn/file-online-preview/releases
windows版
修改启动文件
原:
@echo off
set "KKFILEVIEW_BIN_FOLDER=%cd%"
cd "%KKFILEVIEW_BIN_FOLDER%"
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
echo Starting kkFileView...
echo Please check log file in ../log/kkFileView.log for more information
echo You can get help in our official homesite: https://kkFileView.keking.cn
echo If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers
java -Dspring.config.location=..\config\application.properties -jar kkFileView-4.0.0.jar -> ..\log\kkFileView.log
新: 添加启动命令 -Dfile.encoding=UTF-8 解决:txt、md等文件中文乱码
@echo off
set "KKFILEVIEW_BIN_FOLDER=%cd%"
cd "%KKFILEVIEW_BIN_FOLDER%"
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
echo Starting kkFileView...
echo Please check log file in ../log/kkFileView.log for more information
echo You can get help in our official homesite: https://kkFileView.keking.cn
echo If this project is helpful to you, please star it on https://gitee.com/kekingcn/file-online-preview/stargazers
java -Dspring.config.location=..\config\application.properties -Dfile.encoding=UTF-8 -jar kkFileView-4.0.0.jar -> ..\log\kkFileView.log
配置文件: /config/application.properties
docker 版
docker pull keking/kkfileview
docker run -d --name kk -p 8012:8012 keking/kkfileview
使用时要使用Ip:8012 进行测试。我这边用域名无法预览(可能是我的问题);
试了下支持一些常用格式: docx、txt、xls、sql、md、pdf、dwg、zip、mp4等;
不支持 xmind 等;
linux 版
1、安装 LiberOffice
> wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_rpm.tar.gz
> tar -zxvf LibreOffice_7.1.4_Linux_x86-64_rpm.tar.gz
> cd LibreOffice_7.1.4.2_Linux_x86-64_rpm/RPMS
> yum install -y *.rpm
2、安装中文包
wget https://downloadarchive.documentfoundation.org/libreoffice/old/7.1.4.2/rpm/x86_64/LibreOffice_7.1.4.2_Linux_x86-64_rpm_langpack_zh-CN.tar.gz
3、验证office是否安装成功
> cd /opt/libreoffice7.1/program
> ./soffice --version
=====================================================
如果顺利,此时可以看到一串版本号如下
【LibreOffice 7.1.4.2 a529a4fab45b75fefc5b6226684193eb000654f6】
4、安装kkfileview
> wget https://kkfileview.keking.cn/kkFileView-4.0.0.tar.gz
> tar -zxvf kkFileView-4.0.0.tar.gz
=====================================================
默认端口为 8012, 可以在 kkFileView-4.0.0/config/application.properties 里面修改 server.port
5、启动且日志
创建日志文件
> cd kkFileView-4.0.0/log
> touch kkFileView.log
运行启动程序
> cd ../bin/
> ./startup.sh | ./showlog.sh
观察日志, kkFileView 服务启动完成
标签:https,log,预览,echo,KKFILEVIEW,kkFileView,kkfileview,在线
From: https://www.cnblogs.com/xy20211005/p/16618758.html