Archived Forum Post

Index of archived forum posts

Question:

FTP PutFile 100% before Upload is finished?! (c#)

Nov 27 '13 at 10:41

Hi everyone.

I am trying to uload a file to a ftp server. No TSL/SSL. Passive & Binary mode activated. The file is about 4.8mb and the format is ZIP, containing a TIF file.

When I try to upload this to my local server running on my own PC, it works fine. But when I try to upload it to the actual server, it doesn't work at all. PutFile returns success & the event shows 100% even though the file hasn't been uploaded completely. The size of the uploaded file differs between 1mb and 4mb.

Are there any parameters I could try to improve the upload? Right now I am using: passive=true, SendBufferSize=1024, and I use SetTypeBinary().

LogFile: 
    ChilkatLog:
  PutFile:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: 
    Username: 
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    LocalFilename: 987.zip
    RemoteFilename: 987.zip
    ProgressMonitoring:
      enabled: yes
      heartbeatMs: 100
      sendBufferSize: 4096
    --ProgressMonitoring
    IdleTimeoutMs: 20000
    ReceiveTimeoutMs: 60000
    ConnectTimeoutSeconds: 120
    initialGreeting: 220 ProFTPD 1.3.3g Server () []
    restartNext: 0
    ModeZ: 0
    BinaryMode: 1
    Passive transfer mode
    setupPassiveDataSocket3:
      hostAddr: 
      DataConnect:
        hostname: 
        port: 40954
        ConnectTimeoutMs_1: 120000
        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: 
        myIP_5: **
        myPort_5: 52542
        connect successful (3)
        socketOptions:
          SO_SNDBUF: 65536
          SO_RCVBUF: 65536
          TCP_NODELAY: 0
        --socketOptions
      --DataConnect
    --setupPassiveDataSocket3
    SetupPassiveDataSocket: Elapsed time: 140 millisec
    command: STOR 
    PutFilename: [987.zip]
    DataConnectionReady: Elapsed time: 0 millisec
    StorResponse: 150 Opening BINARY mode data connection for 987.zip
    ReceivedIntermediateResponse: Elapsed time: 63 millisec
    SendBufferSize: 4096
    Sending uncompressed...
    lastBytesSent: 000001000100570000005BA34B000000
    SentData: Elapsed time: 890 millisec
    skipFinalReply: 0
    readFtpControlChannelReply2:
      Timeout waiting to read socket or accept connection
      timeoutMs: 20000
      recvUntilMatch: Socket timeout.
      Failed to read FTP response line..
    --readFtpControlChannelReply2
    FinalReply: Elapsed time: 20094 millisec
    IdleTimeoutMs: 20000
    NumBytesSent: 4957128
    Failed to read 2nd STOR reply
    remoteFtpFile: 987.zip
    TotalTime: Elapsed time: 21187 millisec
    Failed.
  --PutFile
--ChilkatLog

Do you now anything that could fix it?


Answer

try sendbuffer to 32787.

also receive, do not know if makes a difference, I set both.


Answer

success will be false, after percent reaches 100%. But the upload is not complete, just a few KB / MB are uploaded.

When success is false, the my thread will be closed but the upload will continue in the background. Why does it not stop when success == false?

changing the sendbuffer didn't change anything...

log:

ChilkatLog:
  PutFile:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: 
    Username: 
    Architecture: Little Endian; 32-bit
    Language: .NET 4.0
    VerboseLogging: 0
    LocalFilename: 789.zip
    RemoteFilename: 789.zip
    ProgressMonitoring:
      enabled: yes
      heartbeatMs: 100
      sendBufferSize: 524288
    --ProgressMonitoring
    IdleTimeoutMs: 20000
    ReceiveTimeoutMs: 60000
    ConnectTimeoutSeconds: 120
    initialGreeting: 220 ProFTPD 1.3.3g Server () []
    restartNext: 0
    ModeZ: 0
    BinaryMode: 1
    Passive transfer mode
    setupPassiveDataSocket3:
      hostAddr: 
      DataConnect:
        hostname: 
        port: 47396
        ConnectTimeoutMs_1: 120000
        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: 
        myIP_5: *
        myPort_5: 54606
        connect successful (3)
        socketOptions:
          SO_SNDBUF: 65536
          SO_RCVBUF: 65536
          TCP_NODELAY: 0
        --socketOptions
      --DataConnect
    --setupPassiveDataSocket3
    SetupPassiveDataSocket: Elapsed time: 140 millisec
    command: STOR 
    PutFilename: [789.zip]
    DataConnectionReady: Elapsed time: 0 millisec
    StorResponse: 150 Opening BINARY mode data connection for 789.zip
    ReceivedIntermediateResponse: Elapsed time: 63 millisec
    SendBufferSize: 524288
    Sending uncompressed...
    lastBytesSent: 00000100010057000000855697000000
    SentData: Elapsed time: 234 millisec
    skipFinalReply: 0
    readFtpControlChannelReply2:
      Timeout waiting to read socket or accept connection
      timeoutMs: 20000
      recvUntilMatch: Socket timeout.
      Failed to read FTP response line..
    --readFtpControlChannelReply2
    FinalReply: Elapsed time: 20063 millisec
    IdleTimeoutMs: 20000
    NumBytesSent: 9918194
    Failed to read 2nd STOR reply
    remoteFtpFile: 789.zip
    TotalTime: Elapsed time: 20516 millisec
    Failed.
  --PutFile
--ChilkatLog


Answer

Try larger size, this is what I use on all transfers.

FTPBUFFERSENDSIZE=262144 FTPBUFFERRECIEVESIZE=262144

I have gotten the same kind of issues on some of my transfers.

Also with out the set buffer, transfers would take 3 hours, and they now take 20 minutes.