附上網址:kkFileView
1. 選擇部署指南,點擊碼雲發行版本鏈接
2. 下載發行版
3. 雙擊執行有Windows和Linux,根據自己使用的系統來下載
4.瀏覽器訪問本機8012端口 http://127.0.0.1:8012 即可看到項目演示用首頁
5. 項目接入使用,js
//要預覽文件的訪問地址
var url = 'http://127.0.0.1:8080/file/test.txt';
window.open('http://127.0.0.1:8012/onlinePreview?url='+encodeURIComponent(url));
注:每次使用前啟動kkFileView即可,地址可為服務器存放地址
舉例說明:
var url = 'http://192.168.xxx.xxx:8080/file/test.txt';
window.open('http://192.168.xxx.xxx:8012/onlinePreview?url='+encodeURIComponent(url));