FTP connection speed

I have windows desktop application in which i am connecting to FTP server, uploading/downloading some files.
i am using CURLSMBS for FTP connection.

On some machines FTP speed is fine, but on some machines which are in different network speed is very very slow.
on machine it take 2 sec to download a file and another machine it takes about 90 sec.

Does anyone know what could be the problem?

Firewall maybe? Connection type?

Do you have a debug log? (see DebugData property)

Maybe it tries to create data connection, which then times out. Then it tries another way and succeeds.

i am using following code

d=new CURLSMBS
d.CollectDebugData = true
d.CollectOutputData = true

d.OptionVerbose = true
d.OptionURL=“ftp://”+FTPURL+"/Orders/"
d.OptionUsername = UserName
d.OptionPassword = Password
d.OptionDirListOnly = true

e = d.Perform

After transfer, please check DebugData property for the text inside.

Hello Christian,
Here is the Debug log,

ftp_perform ends with SECONDARY: 0
250 Directory successfully changed.
EPSV
Connect data stream passively
229 Entering Extended Passive Mode (|||50866|).
Trying 173.220.58.107:50866…
TCP_NODELAY set
Connecting to 173.220.58.107 (173.220.58.107) port 50866
connect to 173.220.58.107 port 21 failed: Timed out
Failed to connect to 173.220.58.107 port 21: Timed out
Failed EPSV attempt. Disabling EPSV
PASV
227 Entering Passive Mode (173,220,58,107,243,207).
Trying 173.220.58.107:62415…
TCP_NODELAY set
Connecting to 173.220.58.107 (173.220.58.107) port 62415
Connected to 173.220.58.107 (173.220.58.107) port 21 (#0)
TYPE A
200 Switching to ASCII mode.
NLST

You saw that. And then EPSV is disabled.
You can set option OptionFTPUseEPSV = false for this connection to disable it right away.

Try increasing OptionUploadBufferSize

Thanks Christian,
This worked for me.

1 Like