Error when uploading multiple files

0 votes
asked Aug 12, 2011 by NickS (170 points)
edited Oct 11, 2011

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
commented Aug 12, 2011 by Lukas Pokorny (123,550 points)
edited Aug 12, 2011

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
answered Aug 15, 2011 by Lukas Pokorny (123,550 points)
edited Aug 15, 2011

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.

...