Archived Forum Post

Index of archived forum posts

Question:

FTP upload not starting

Jul 29 '13 at 14:52

this code returns "TRUE", problem is that nothing happens. no error message no upload, nothing.

                 ftpUploadslot1.EnableEvents = True
            ' Set our heartbeat interval to .1 seconds:
            ftpUploadslot1.HeartbeatMs = 100

            Dim success As Boolean
            ' Connect and login to the FTP server.
            success = ftpUploadslot1.Connect()
            If (success <> True) Then
                MsgBox(ftpUploadslot1.LastErrorText)
                Exit Sub
            End If
            ' Change to the remote directory where the file will be uploaded.
            success = ftpUploadslot1.ChangeRemoteDir(remoteDirectory)
            If (success <> True) Then
                MsgBox(ftpUploadslot1.LastErrorText)
                Exit Sub
            End If
            success = ftpUploadslot1.AsyncPutFileStart(sFile, remoteFilename)

on server side the log tells me that the program connected, changed directory and then just stayed there. this is what i have in the log:

ChilkatLog:
  UnlockComponent:
    DllDate: Jul  9 2013
    ChilkatVersion: 9.4.1.26
    UnlockPrefix: NONE
    Username: SHARKY:Igor
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    component: Ftp2
    unlockCode: Anything for 30-day trial
    RegKey:
      LibDate: Jul  9 2013
      dateStr: 7 28 2013
      mdy: 7/28/2013
      expireMdy: 8/27/2013
      keyT: 1377558000
      curT: 1374966000
      curDT: Sun, 28 Jul 2013 12:16:25 +0200
      Component successfully unlocked using trial key
    --RegKey
    Success.
  --UnlockComponent
--ChilkatLog

ChilkatLog:
  AsyncPutFileStart:
    DllDate: Jul  9 2013
    ChilkatVersion: 9.4.1.26
    UnlockPrefix: Anything for 30-day trial
    Username: SHARKY:Igor
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    hcCurDate: Sun, 28 Jul 2013 12:16:45 +0200
    hcExpire: 11/2013
    remoteFilepath: IMG_1629.JPG
    localFilepath: I:\igor\Stock Textrue\IMG_1629.JPG
  --AsyncPutFileStart
--ChilkatLog

any help appreciated.

Igor

UPDATE: this is the SERVER log with just one single putfile

000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.41 beta
(000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> USER root
(000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> 331 Password required for root
(000012)29/07/2013 20.16.57 - (not logged in) (127.0.0.1)> PASS *
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 230 Logged on
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> TYPE I
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 200 Type set to I
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> SYST
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 215 UNIX emulated by FileZilla
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> FEAT
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 211-Features:
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  MDTM
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  REST STREAM
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  SIZE
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  MLST type*;size*;modify*;
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  MLSD
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  UTF8
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  CLNT
(000012)29/07/2013 20.16.57 - root (127.0.0.1)>  MFMT
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 211 End
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> CWD /dir1
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 250 CWD successful. "/dir1" is current directory.
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> PASV
(000012)29/07/2013 20.16.57 - root (127.0.0.1)> 227 Entering Passive Mode (79,20,106,83,7,30)
(000012)29/07/2013 20.18.57 - root (127.0.0.1)> 421 Connection timed out.
(000012)29/07/2013 20.18.57 - root (127.0.0.1)> disconnected.

and here is the chilkat log after the timeout:

ChilkatLog:
  PutFile:
    DllDate: Jul  9 2013
    ChilkatVersion: 9.4.1.26
    UnlockPrefix: Anything for 30-day trial
    Username: SHARKY:Igor
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    hcCurDate: Mon, 29 Jul 2013 20:33:26 +0200
    hcExpire: 11/2013
    LocalFilename: I:\igor\Stock Textrue\IMG_1631_a.jpg
    RemoteFilename: IMG_1631_a.jpg
    ProgressMonitoring:
      enabled: yes
      heartbeatMs: 100
      sendBufferSize: 65536
    --ProgressMonitoring
    IdleTimeoutMs: 60000
    ReceiveTimeoutMs: 60000
    ConnectTimeoutSeconds: 60
    initialGreeting: 220-FileZilla Server version 0.9.41 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
    restartNext: 0
    ModeZ: 0
    BinaryMode: 1
    Passive transfer mode
    setupPassiveDataSocket3:
      hostAddr: 79.20.106.83
      DataConnect:
        hostname: 79.20.106.83
        port: 2523
        ConnectTimeoutMs_1: 60000
        This is an IPV4 numeric address.
        Hostname to IP address resolution not needed.
        AddrInfoList:
          AddrInfo:
            ai_flags: 4
            ai_family: 2
            ai_socktype: 1
            ai_protocol: 0
            ai_addrlen: 16
            ai_canonname: (NULL)
          --AddrInfo
        --AddrInfoList
        Connecting to IPV4 address.
        ipAddress2: 79.20.106.83
        timeout waiting for connect to complete;
        Connect function failed
      --DataConnect
      setupPassiveDataSocket dataConnect failed.
    --setupPassiveDataSocket3
    SetupPassiveDataSocket: Elapsed time: 60123 millisec
    Failed to setup passive data socket for PutFile
    TotalTime: Elapsed time: 60123 millisec
    Failed.
  --PutFile
--ChilkatLog


Answer

See How to Determine Settings for FTP Data Connections


Answer

Perhaps set the Passive propery to true helps.


Answer

The AsyncPutFileStart method starts the upload in a background thread. Once the upload is finished, you can get information about the success/failure, and if it failed, then information is available in the AsyncLog property. See this example: http://www.example-code.com/csharp/ftp_asyncUpload.asp

I would recommend first getting it working using a simple synchronous call to PutFile. Then if you need asyc, replace the single call to PutFile with the more complicated code to do it asynchronously. Please remember -- the only point in doing it asynchronously is to free up your app to do other things in the main UI thread. If you're simply waiting for the async call to complete in the UI thread, it's pointless. You may as well call PutFile...