Compare commits

..

5 Commits

Author SHA1 Message Date
551eeb0390 2.1.1版 2019-07-09 10:46:21 +08:00
11d6ad1ed3 修复文件下载流URL参数中包含中文URL编码不正确导致HTTP-400异常 2019-07-09 10:46:21 +08:00
e57db6925c 修复config.js 404问题 2019-07-09 10:46:21 +08:00
87096364d8 首页示例修改、首页更新记录 2019-07-09 10:46:21 +08:00
ad8027a7d0 2.1.1迭代 2019-07-09 10:46:21 +08:00
8 changed files with 54 additions and 49 deletions

View File

@ -27,5 +27,5 @@ RUN yum install -y kde-l10n-Chinese &&\
mkfontdir &&\
fc-cache -fv
ENV LC_ALL zh_CN.UTF-8
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-2.1.0/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-2.1.0/conf/application.properties","-jar","/opt/kkFileView-2.1.0/bin/kkFileView-2.1.0.jar"]
ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-2.1.1/bin
ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider","-Dspring.config.location=/opt/kkFileView-2.1.1/conf/application.properties","-jar","/opt/kkFileView-2.1.1/bin/kkFileView-2.1.1.jar"]

View File

@ -12,7 +12,7 @@
<groupId>cn.keking</groupId>
<artifactId>kkFileView</artifactId>
<version>2.1.0</version>
<version>2.1.1</version>
<properties>

View File

@ -4,4 +4,4 @@ cd "%KKFILEVIEW_BIN_FOLDER%"
echo Using KKFILEVIEW_BIN_FOLDER %KKFILEVIEW_BIN_FOLDER%
echo Starting kkFileView...
echo Please check log file for more information
java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=..\conf\application.properties -jar kkFileView-2.1.0.jar -> ..\log\kkFileView.log
java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=..\conf\application.properties -jar kkFileView-2.1.1.jar -> ..\log\kkFileView.log

View File

@ -27,4 +27,4 @@ else
fi
echo "Starting kkFileView..."
echo "Please check log file for more information"
nohup java -Dfile.encoding=UTF-8 -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=../conf/application.properties -jar kkFileView-2.1.0.jar > ../log/kkFileView.log 2>&1 &
nohup java -Dfile.encoding=UTF-8 -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=../conf/application.properties -jar kkFileView-2.1.1.jar > ../log/kkFileView.log 2>&1 &

View File

@ -123,30 +123,35 @@ public class DownloadUtils {
* 对最有一个路径进行转码
* @param urlAddress
* http://192.168.2.111:8013/demo/Handle中文.zip
* http://192.168.2.111:8013/download?id=1&filename=中文.zip
* @return
*/
private String encodeUrlParam(String urlAddress) {
String newUrl = "";
try {
String path = "";
String param = "";
if (urlAddress.contains("?")) {
path = urlAddress.substring(0, urlAddress.indexOf("?"));
param = urlAddress.substring(urlAddress.indexOf("?"));
}else {
path = urlAddress;
private String encodeUrlParam(String urlAddress){
StringBuffer sb = new StringBuffer();
for (int i = 0; i < urlAddress.length(); i++) {
char c = urlAddress.charAt(i);
if (c >= 0 && c <= 255) {
sb.append(c);
} else {
byte[] b;
try {
//指定需要的编码类型
b = String.valueOf(c).getBytes("utf-8");
} catch (Exception ex) {
System.out.println(ex);
b = new byte[0];
}
for (int j = 0; j < b.length; j++) {
int k = b[j];
if (k < 0) {
k += 256;
}
sb.append("%" + Integer.toHexString(k).toUpperCase());
}
}
String lastPath = path.substring(path.lastIndexOf("/") + 1);
String leftPath = path.substring(0, path.lastIndexOf("/") + 1);
String encodeLastPath = URLEncoder.encode(lastPath, "UTF-8");
newUrl += leftPath + encodeLastPath;
if (urlAddress.contains("?")) {
newUrl += param;
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return newUrl;
return sb.toString();
}

View File

@ -27,17 +27,9 @@ See https://github.com/adobe-type-tools/cmap-resources
<meta name="google" content="notranslate">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PDF.js viewer</title>
<link rel="stylesheet" href="viewer.css">
<!-- This snippet is used in production (included from viewer.html) -->
<link rel="resource" type="application/l10n" href="locale/locale.properties">
<script src="../build/pdf.js"></script>
<script src="../../config.js"></script>
<link rel="resource" type="application/l10n" href="locale/locale.properties">
<script src="../build/pdf.js"></script>
<script src="viewer.js"></script>
</head>

View File

@ -29,22 +29,15 @@
如果你的项目需要接入文件预览项目达到对docx、excel、ppt、jpg等文件的预览效果那么通过在你的项目中加入下面的代码就可以
成功实现:
<pre style="background-color: #2f332a;color: #cccccc">
$scope.openWin = function (fileUrl) {
var url = configuration.previewUrl + encodeURIComponent(fileUrl);
var winHeight = window.document.documentElement.clientHeight-10;
$window.open(url, "_blank", "height=" + winHeight
+ ",top=80,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes");
};
var url = 'http://127.0.0.1:8080/file/test.txt'; //要预览文件的访问地址
window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(url));
</pre>
</div>
<div>
新增多图片同时预览功能,接口如下:
<pre style="background-color: #2f332a;color: #cccccc">
var fileUrl =url1+"|"+"url2";//多文件使用“|”字符隔开
var url = "http://localhost:8012/picturesPreview?urls" + encodeURIComponent(fileUrl);
var winHeight = window.document.documentElement.clientHeight-10;
$window.open(url, "_blank", "height=" + winHeight
+ ",top=80,left=80,toolbar=no, menubar=no, scrollbars=yes, resizable=yes");
var fileUrl =url1+"|"+"url2";//多文件使用“|”字符隔开
window.open('http://127.0.0.1:8012/picturesPreview?urls='+encodeURIComponent(fileUrl));
</pre>
</div>
</div>
@ -86,8 +79,23 @@
<div id="collapseThree" class="panel-collapse collapse in">
<div class="panel-body">
<div>
2019年06月18日 <br>
1. 支持自动清理缓存及预览文件<br>
2. 支持http/https下载流url文件预览<br>
3. 支持FTP url文件预览<br>
4. 加入Docker构建<br><br>
2019年04月08日 <br>
1. 缓存及队列实现抽象提供JDK和REDIS两种实现(REDIS成为可选依赖)<br>
2. 打包方式提供zip和tar.gz包并提供一键启动脚本<br><br>
2018年01月19日 <br>
1. 大文件入队提前处理<br>
1. 新增addTask文件转换入队接口<br>
1. 采用redis队列支持kkFIleView接口和异构系统入队两种方式<br><br>
2018年01月15日 <br>
1.首页新增社会化评论框<br><br>
1.首页新增社会化评论框<br><br>
2018年01月12日 <br>
1.新增多图片同时预览<br>
@ -100,7 +108,7 @@
4.引入pdf.js预览doc等文件支持doc标题生成pdf预览菜单支持手机端预览<br><br>
2017年12月12日<br>
1.项目osc开源:<a href="https://gitee.com/kekingcn/file-online-preview" target="_blank">https://gitee.com/kekingcn/file-online-preview</a><br>
1.项目gitee开源:<a href="https://gitee.com/kekingcn/file-online-preview" target="_blank">https://gitee.com/kekingcn/file-online-preview</a><br>
2.项目github开源:<a href="https://github.com/kekingcn/kkFileView" target="_blank">https://github.com/kekingcn/kkFileView</a>
</div>
</div>

View File

@ -5,7 +5,7 @@
<groupId>cn.keking</groupId>
<artifactId>filepreview</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>2.1.1</version>
<modules>
<module>jodconverter-core</module>
<module>jodconverter-web</module>