Archived Forum Post

Index of archived forum posts

Question:

425 Can't open data connection for transfer of...filename

Oct 10 '15 at 11:55

I am getting the above error when using FTP in VB6. I have tried all combinations of ftp.Passive, ftp.AuthTls, ftp.Ssl. ftp.Passive=0 seems to allow me to get further than other combinations. When I run FTP in the command line, I can upload a file successfully, but the code in a VB6 exe fails on the ftp.AsyncPutFileStart command with the above response. Can you help?


Answer

Can you post a code sample?

Also, post the contents of the LastErrorText property as they exist immediately after the failing call - there might be useful information there.


Answer

Hi,

The log file with additional output from the VB6 code is:

10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 FTP_Backup Start 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 FTP_Backup LocalFileName=D:tempBACKUP20151010_001154.7z RemoteFileName="The_Venue_TheVenue_20151010_001154.7z" 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 ftp.UnlockComponent ('Anything for 30-day trial') 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 ftp.Passive = 0 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 success = ftp.Connect() 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 ============================================================== 
10/10/2015 00:21:13 FTP_File Connect OK ChilkatLog:
  Connect_Ftp2:
    DllDate: Aug 26 2015
    ChilkatVersion: 9.5.0.52
    UnlockPrefix: Anything for 30-day trial
    Username: KRACER:Keith
    Architecture: Little Endian; 32-bit
    Language: ActiveX
    VerboseLogging: 0
    ProgressMonitoring:
      enabled: yes
      heartbeatMs: 0
      sendBufferSize: 65536
    --ProgressMonitoring
    ImplicitSsl: 0
    AuthTls: 0
    AuthSsl: 0
    ftpConnect:
      Hostname: ftp1.xxxxxxxx.com
      Port: 21
      IdleTimeoutMs: 60000
      socketOptions:
        SO_SNDBUF: 262144
        SO_RCVBUF: 4194304
        TCP_NODELAY: 1
        SO_KEEPALIVE: 0
      --socketOptions
      readCommandResponse:
        replyLineQP: 220 It is a criminal offence to access this site if you do not have permiss=
ion.
      --readCommandResponse
      initialStatus: 220
      initialResponse: 220 It is a criminal offence to access this site if you do not have permission.
    --ftpConnect
    Logging in...
    Login:
      sendCommand:
        sendingCommand: USER The_Venue
      --sendCommand
      readCommandResponse:
        replyLineQP: 331 Password required for the_venue
      --readCommandResponse
      sendCommand:
        sendingCommand: PASS 
      --sendCommand
      readCommandResponse:
        replyLineQP: 230 Logged on
      --readCommandResponse
      FTP authentication successful.
      setTransferMode:
        simpleCommand:
          sendCommand:
            sendingCommand: TYPE I
          --sendCommand
          readCommandResponse:
            replyLineQP: 200 Type set to I
          --readCommandResponse
        --simpleCommand
      --setTransferMode
    --Login
    Login successful.
    syst:
      simpleCommand:
        sendCommand:
          sendingCommand: SYST
        --sendCommand
        readCommandResponse:
          replyLineQP: 215 UNIX emulated by FileZilla
        --readCommandResponse
      --simpleCommand
    --syst
    Syst: UNIX emulated by FileZilla
    simpleCommand:
      sendCommand:
        sendingCommand: FEAT
      --sendCommand
      readCommandResponse:
        replyLineQP: 211-Features:
        replyLineQP:  MDTM
        replyLineQP:  REST STREAM
        replyLineQP:  SIZE
        replyLineQP:  MLST type;size;modify;
        replyLineQP:  MLSD
        replyLineQP:  AUTH SSL
        replyLineQP:  AUTH TLS
        replyLineQP:  PROT
        replyLineQP:  PBSZ
        replyLineQP:  UTF8
        replyLineQP:  CLNT
        replyLineQP:  MFMT
        replyLineQP:  EPSV
        replyLineQP:  EPRT
        replyLineQP: 211 End
      --readCommandResponse
    --simpleCommand
    Sending OPTS UTF8 ON
    simpleCommand:
      sendCommand:
        sendingCommand: OPTS UTF8 ON
      --sendCommand
      readCommandResponse:
        replyLineQP: 202 UTF8 mode is always enabled. No need to send this command.
      --readCommandResponse
    --simpleCommand
    Success.
  --Connect_Ftp2
--ChilkatLog

10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:13 success = ftp.ChangeRemoteDir(vUserName) 10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:13 success = ftp.AsyncPutFileStart(localFilename, remoteFilename) 10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:13 Do While ftp.AsyncFinished <> 1 10/10/2015 00:21:13 ============================================================== 10/10/2015 00:21:24 ============================================================== 10/10/2015 00:21:24 If (ftp.AsyncSuccess = 1) Then 10/10/2015 00:21:24 ============================================================== 10/10/2015 00:21:24 ============================================================== 10/10/2015 00:21:24 FTP_File Async Error=ChilkatLog: AsyncPutFileStart: DllDate: Aug 26 2015 ChilkatVersion: 9.5.0.52 UnlockPrefix: Anything for 30-day trial Username: KRACER:Keith Architecture: Little Endian; 32-bit Language: ActiveX VerboseLogging: 0 remoteFilepath: "The_Venue_TheVenue_20151010_001154.7z" localFilepath: D:tempBACKUP20151010_001154.7z --AsyncPutFileStart --ChilkatLog

ChilkatLog: AsyncPutFile: DllDate: Aug 26 2015 ChilkatVersion: 9.5.0.52 UnlockPrefix: Anything for 30-day trial Username: KRACER:Keith Architecture: Little Endian; 32-bit Language: ActiveX VerboseLogging: 0 uploadFromLocalFile: localFileSize: 5414458 uploadFromDataSource: initialGreeting: 220 It is a criminal offence to access this site if you do not have permission. restartNext: 0 modeZ: 0 binaryMode: 1 setupDataConnection: active transfer mode setupActiveDataSocket: Using ephemeral port range for Active data connection. dataPort: 59190 portIpAddress: 192.168.254.115 MyIPv4: 192,168,254,115,231,54 sendCommand: sendingCommand: PORT 192,168,254,115,231,54 --sendCommand readCommandResponse: replyLineQP: 200 Port command successful --readCommandResponse --setupActiveDataSocket --setupDataConnection sendUploadCommand: sendCommand: sendingCommand: STOR "The_Venue_TheVenue_20151010_001154.7z" --sendCommand --sendUploadCommand completeDataConnection: acceptDataConnection: controlChannelReply: Reading intermediate response.. readCommandResponse: replyLineQP: 150 Opening data channel for file upload to server of "/The_Venue/The_Venue= _TheVenue_20151010_001154.7z" --readCommandResponse --controlChannelReply controlChannelReply: Reading intermediate response.. readCommandResponse: replyLineQP: 425 Can't open data connection for transfer of "/The_Venue/The_Venue_TheVen= ue_20151010_001154.7z" --readCommandResponse Final response indicates error. --controlChannelReply --acceptDataConnection Failed to accept data connection. --completeDataConnection Failed to complete data connection. --uploadFromDataSource Failed. --uploadFromLocalFile --AsyncPutFile --ChilkatLog

10/10/2015 00:21:24 ============================================================== 10/10/2015 00:21:24 ============================================================== 10/10/2015 00:21:24 success = ftp.Disconnect() 10/10/2015 00:21:24 ==============================================================


Answer

If you do some searching on FTP error 425, it seems like it's usually an issue with the application being blocked by a firewall (software and/or hardware). There are a number of forum posts at other forums on how to resolve this issue, so I would try those first and see if you make any progress.