0 votes
by (170 points)
edited

Hi

I am getting an error when I send multiple files my code is as follows:

strExistingFile = GetImagePath() & "" & intInvNum & "-1.jpg"

'if it exists then load it If FileExists(strExistingFile) Then strGlobalFTPFilename = strExistingFile client.PutFile(strExistingFile, GetFTPImageFolder() & intInvNum & "-1.jpg") End If

'Now the second strExistingFile = GetImagePath() & "" & intInvNum & "-2.jpg"

'if it exists then load it If FileExists(strExistingFile) Then strGlobalFTPFilename = strExistingFile client.PutFile(strExistingFile, GetFTPImageFolder() & intInvNum & "-2.jpg") End If

The first file will load but the second throws an exception:

Cannot send command to server because response for previous one was not received.

The files I am tryimg to send arre around 50k.

Any help would be appreciated.

Nick Steele

Applies to: Rebex FTP/SSL
by (147k points)
edited

This exception is usually thrown when one method fails with a timeout exception which is ignored. Would it be possible to create a communication log using Ftp object's LogWriter property (as described at http://www.rebex.net/kb/logging.aspx) and add it to your post or mail it to support@rebex.net? That should make it possible to tell what is going on.

1 Answer

0 votes
by (147k points)
edited

It turned out this was caused by calling client.SendCommand("SITE CHMOD 666 file.txt") without the corresponding FtpResponse response = client.ReadResponse(); before transferring the file.

...