1.搭建
(1)控制面板--->程序----->将FTP服务器打勾

(2)输入iis,或者右键桌面-->管理-->服务和应用程序--->internet information service,右键网站,添加FTP站点。

(3)cmd输入ipconfig/all,查询本机ip地址,将Ip地址填入。

(4)打勾如下

(5)确定,然后重启计算机生效。加入Ip地址是1.2.3.4,在浏览器输入ftp://1.2.3.4,跳转至物理地址。
2.客户端下载文件实例
from ftplib import FTP
import sys,os
print(sys.executable)
os.chdir(r'C:\Users\旺仔QQ糖\Desktop\webpageDesign')
filepath='pic'
Host='1.2.3.4'
files=['1.png','2.png','3.png','4.png']
def getFiles(files,ftp,bufsize):
for file in files:
ftp.retrbinary('retr '+file,open(file,'wb').write,bufsize)
f=FTP(Host)
f.login()
print('success login')
f.encoding='GB18030' # encod chinese character
f.cwd(filepath)
getFiles(files,f,1024)
需要注意的是需要 f.encoding='GB18030',否则汉字将出现乱码。
来源:https://www.cnblogs.com/johnyang/p/12376833.html