ftp icon indicating copy to clipboard operation
ftp copied to clipboard

229 Entering Extended Passive Mode (|||45368|) when attempting to read the file repeatedly after creating a connection only once. Report an error

Open chenpb-lu opened this issue 1 year ago • 2 comments
trafficstars

func t(filePath string) {
	c, err := ftp.Dial(ftpServer, ftp.DialWithTimeout(5*time.Second))
	if err != nil {
		log.Fatal(fmt.Sprintf("filePath: %s err: %v", filePath, err))
	}

	err = c.Login(ftpUser, ftpPasswd)
	if err != nil {
		log.Fatal(fmt.Sprintf("filePath: %s err: %v", filePath, err))
	}

	for i := 0; i < 5; i++ {
		_, err := c.Retr(filePath)
		if err != nil {
			log.Fatal(fmt.Sprintf("filePath: %s err: %v", filePath, err))
		}
	}
	if err := c.Quit(); err != nil {
		log.Fatal(err)
	}
}

chenpb-lu avatar Apr 10 '24 08:04 chenpb-lu