Modified:
ZopeChinaPak/trunk/TODO.txt
ZopeChinaPak/trunk/ZopePak.py
ZopeChinaPak/trunk/ftp_pak.py
Log:
- 关闭dav的hack,对dav还是很难很好支持
- 更好的支持在windows的文件夹中,拖放中文文件名的文件夹
Modified: ZopeChinaPak/trunk/TODO.txt
==============================================================================
--- ZopeChinaPak/trunk/TODO.txt (original)
+++ ZopeChinaPak/trunk/TODO.txt Tue Jul 11 15:41:38 2006
@@ -1 +0,0 @@
-fix plone filename encoding problem
Modified: ZopeChinaPak/trunk/ZopePak.py
==============================================================================
--- ZopeChinaPak/trunk/ZopePak.py (original)
+++ ZopeChinaPak/trunk/ZopePak.py Tue Jul 11 15:41:38 2006
@@ -6,4 +6,4 @@
ObjectManager.bad_id=re.compile(r'[^a-zA-Z0-9-_~,.$\(\)# ]%').search #TS
import ftp_pak
-import dav_pak
+# import dav_pak
Modified: ZopeChinaPak/trunk/ftp_pak.py
==============================================================================
--- ZopeChinaPak/trunk/ftp_pak.py (original)
+++ ZopeChinaPak/trunk/ftp_pak.py Tue Jul 11 15:41:38 2006
@@ -97,3 +97,21 @@
from ZServer.FTPServer import zope_ftp_channel
zope_ftp_channel.rnfr_completion = rnfr_completion
+old_cmd_cwd = zope_ftp_channel.cmd_cwd
+def cmd_cwd (self, line):
+ """ 当上传一个中文名文件夹的时候,windows自带的webfolder会发送带 ``??`` CWD命令::
+
+ 61.171.153.131 4205 <== opts utf8 on
+ 61.171.153.131 4205 ==> 500 'opts': command not understood.
+ 61.171.153.131 4205 <== PWD
+ 61.171.153.131 4205 ==> 257 "/" is the current directory.
+ 61.171.153.131 4205 <== CWD /nhd/gongsiziliao/danju/??/
+ 61.171.153.131 4205 ==> 550 No such directory.
+ """
+
+ if line[1].find('/??/') != -1:
+ self.respond('250 ?? in path, skip this command, hacked by zopen.cn.')
+ return
+ old_cmd_cwd (self, line)
+
+zope_ftp_channel.cmd_cwd = cmd_cwd