go get -u -v github.com/dutchcoders/goftp 1 然后配置好ftp服务器,编译执⾏以下代码,代码包括列出列表和上传功能:package main import ("github.com/dutchcoders/goftp""fmt""os")func main() { var err error var ftp *goftp.FTP // For debug messages: goftp.ConnectDbg("ftp.server.com:21...
err = ftp.Login(ftpuser, pw) if err != nil { fmt.Println(err) } //注意是 pub/log,不能带“/”开头 ftp.ChangeDir("pub/log") dir, err := ftp.CurrentDir() fmt.Println(dir) ftp.MakeDir(remoteSavePath) ftp.ChangeDir(remoteSavePath) dir, _ = ftp.CurrentDir() fmt.Println(dir) f...