背景
go 操作 ftp , 使用 github.com/jlaffaye/ftp这个库
ftp server 是客户提供的,我们无法进行配置
问题复现
登录时报错,错误如题

解决方案
添加参数,禁用 utf8
ftp.Dial("ftp.example.com:21", ftp.DialWithTimeout(5*time.Second), ftp.DialWithDisabledUTF8(true))

原因
ftp Server 不支持 utf-8 编码, 泪目
go 操作 ftp , 使用 github.com/jlaffaye/ftp这个库
ftp server 是客户提供的,我们无法进行配置
登录时报错,错误如题

添加参数,禁用 utf8
ftp.Dial("ftp.example.com:21", ftp.DialWithTimeout(5*time.Second), ftp.DialWithDisabledUTF8(true))

ftp Server 不支持 utf-8 编码, 泪目
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。