Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

125 Data connection already open; Transfer starting. #29

Open
netaxcess opened this issue Feb 21, 2017 · 5 comments
Open

125 Data connection already open; Transfer starting. #29

netaxcess opened this issue Feb 21, 2017 · 5 comments

Comments

@netaxcess
Copy link

netaxcess commented Feb 21, 2017

`package main

import (

//"crypto/sha256"

//"crypto/tls"
"fmt"
"io"
"os"

//"encoding/hex"
"github.com/dutchcoders/goftp"

)

func main() {
var err error
var ftp *goftp.FTP
var server = "ftpserver"

// For debug messages: goftp.ConnectDbg("ftpserver")
if ftp, err = goftp.Connect(server); err != nil {
    panic(err)
}
defer ftp.Close()
fmt.Println("Successfully connected to", server)

// TLS client authentication


// Username / password authentication
if err = ftp.Login("ftpuser", "ftppwd"); err != nil {
    panic(err)
}

if err = ftp.Cwd("/ff"); err != nil {
    panic(err)
}

var curpath string
if curpath, err = ftp.Pwd(); err != nil {
    panic(err)
}
fmt.Println("Current path:", curpath)


// Upload a file


// Download each file into local memory, and calculate it's sha256 hash
_,err =ftp.Retr("f.zip", func(r io.Reader) error {
    
	dst, err := os.OpenFile("f.zip", os.O_WRONLY|os.O_CREATE, 0644)
	defer dst.Close() 
	if _, err = io.Copy(dst, r); err != nil {
		return err
	}
	return err
})

}`
use ftp to download zip file,has this error

125 Data connection already open; Transfer starting.

@colmdo
Copy link

colmdo commented Feb 28, 2017

Hello , I have same issue with Windows NT IIS ftp server which does not seem to support MLSD :
---> SYST 215 Windows_NT Remote system type is Windows_NT. ---> FEAT 211-FEAT SIZE MDTM 211 END features[FEAT_FEAT] = 1 features[FEAT_MDTM] = 1 features[FEAT_MLST] = 0 features[FEAT_REST_STREAM] = 0 features[FEAT_SIZE] = 1 features[FEAT_TVFS] = 0

The Walk function then tries LIST but does not parse correctly what came back
-rwxrwxrwx 1 owner group 1922 Feb 28 13:46 u_ex170228.log\r\n

I can help with testing the bugfix if needed

Regards, Colm

@netaxcess
Copy link
Author

hope you can help me. How to operate it, how to contact you

@beardww
Copy link

beardww commented Jul 12, 2017

commenting out the following in the List function, in file ftp.go
seemed to have fixed my issue with (125 Data connection already open; Transfer starting.)

		if !strings.HasPrefix(line, StatusFileOK) {
			// Really list is not working here
			err = errors.New(line)
			return
		}

@miladz68
Copy link

same issue here, listing the remote files gives the same error as :

125 Data connection already open; Transfer starting

@jaroteko18
Copy link

jaroteko18 commented May 31, 2018

Try to use only ftp.Retr(pathtofile+"f.zip", func(r io.Reader)) and remove ftp.Cwd & ftp.Pwd
It should works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants