- 修正 wretch 密碼相簿無法下載
- 修正部分 wretch 相簿無法下載
- 修正部分 pchome 相簿無法下載、漏列出相簿
使用 tcl http + tls 從 nginx 取得資料。根據之前的經驗
1. tls enable tls1
package require http package require tls http::register https 443 ::tls::socket set tok [::http::geturl "https://192.168.72.77/index.html"]結果出現錯誤...
error reading "sock580": software caused connection abort SSL channel "sock580": error: tls invalid ecpointformat list用 tls 試看看,出現相同的錯誤...
set sck [tls::socket 192.168.72.77 443] tls::handshake $sck看起來在 handshake 就掛了,google 不到相關資料。奇怪的是 http server 改成 apache 後就沒問題,害我一開始花不少時間研究 nginx 的 ssl 設定。最後的解決方法有:
1. tls enable tls1
http::register https 443 [list ::tls::socket -tls1 1] set tok [::http::geturl "https://192.168.72.77/index.html"]2. 別用 tls 1.6.1 (怒),另一台電腦上用的是 tls 1.6 就沒問題
有些需要管理者權限的命令無法用 exec 執行,例如設定 ip
% exec netsh interface ipv4 add address 10 192.168.0.222 要求的作業需要提高的權限 (以系統管理員身分執行)。 child process exited abnormally使用 twapi 的 shell_execute 加上 -verb runas 解決
::twapi::shell_execute -path "c:/windows/system32/netsh.exe" -params "interface ipv4 delete address 10 192.168.0.222" -verb runas
CKEditor 的 config.js 中加入
config.filebrowserBrowseUrl = 'lib/kcfinder/browse.php?type=files'; config.filebrowserImageBrowseUrl = 'lib/kcfinder/browse.php?type=images'; config.filebrowserFlashBrowseUrl = 'lib/kcfinder/browse.php?type=flash'; config.filebrowserUploadUrl = 'lib/kcfinder/upload.php?type=files'; config.filebrowserImageUploadUrl = 'lib/kcfinder/upload.php?type=images'; config.filebrowserFlashUploadUrl = 'lib/kcfinder/upload.php?type=flash';KCFinder 的 config.php 設定 session,user 登入後再設定 $_SESSION['mysite']['KCFINDER']['disabled'] = false;
'_sessionVar' => &$_SESSION['mysite']['KCFINDER'],要放在 jQuery UI 的 dialog 中時忘記遇到什麼問題,後來改成在 dialog open 時才將 ckeditor 載入,dialog close 時再清掉。
$("#dialog-news").dialog({
open: function () {
$(this).find('textarea').ckeditor({height:360});
},
close: function () {
$(this).find('textarea').val('').ckeditorGet().destroy();
}
});
嵌入 KCFinder (例如按下某個 button 後跳出 KCFinder browser 的視窗,選擇檔案後返回)$('#dialog-news button[name="attach"]').click(function(){
window.KCFinder = {
callBack: function(url) {
window.KCFinder = null;
$('#dialog-news input[name="link"]').val('.'+url);
}
};
window.open('lib/kcfinder/browse.php?type=files&dir=files/attachment', 'kcfinder_textbox',
'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
'resizable=1, scrollbars=0, width=800, height=600'
);
return false;
});
KCFinder 上傳檔案改成 time stamp 加檔名,修改 core/uploader.php 中 public function upload()$filename = date('YmdHis') . '-' . $this->normalizeFilename($file['name']);
$target = file::getInexistantFilename($dir . $filename);
訂閱:
文章 (Atom)