ftputil 库和 JPG 文件的问题
Issue with ftputil library and JPG-files
我有下面显示的代码
for root, dirs, files in ftp_host.walk(ftp_host.curdir, topdown=False):
if ftp_host.path.isdir(root):
for folder in ftp_host.path.normpath(root).split('/'):
target_dir = os.path.join(target_dir, folder)
if not os.path.exists(target_dir):
os.mkdir(target_dir)
for name in files:
target_file = os.path.join(target_dir, name)
# print name - I am able to see all files here including *.JPG
if ftp_host.path.isfile(name):
# print name - there no any *.JPG
ftp_host.download(name, target_file)
target_dir = curdir
当我尝试从目标 FTP 递归下载所有文件时,我无法下载任何 JPG。
哪里不对请指教
我的错...我没有正确移动到特定目录。 httputils 工作得很好!
我有下面显示的代码
for root, dirs, files in ftp_host.walk(ftp_host.curdir, topdown=False):
if ftp_host.path.isdir(root):
for folder in ftp_host.path.normpath(root).split('/'):
target_dir = os.path.join(target_dir, folder)
if not os.path.exists(target_dir):
os.mkdir(target_dir)
for name in files:
target_file = os.path.join(target_dir, name)
# print name - I am able to see all files here including *.JPG
if ftp_host.path.isfile(name):
# print name - there no any *.JPG
ftp_host.download(name, target_file)
target_dir = curdir
当我尝试从目标 FTP 递归下载所有文件时,我无法下载任何 JPG。
哪里不对请指教
我的错...我没有正确移动到特定目录。 httputils 工作得很好!