I'm trying to run an FTP download with the following code:

var client = FtpConnect(hostName, port, username, password);
client.GetFiles(downloadFilesPath, downloadDirectoryPath, FtpBatchTransferOptions.Recursive, FtpActionOnExistingFiles.OverwriteAll);

Everytime I try to run it I receive the error "Unable to parse server response to SIZE command."

Log Text:


2011-11-02 16:12:48.040 Opening log file.
2011-11-02 16:12:48.061 INFO Ftp(1) Command: TYPE I
2011-11-02 16:12:48.115 INFO Ftp(1) Response: 200 Type set to I.
2011-11-02 16:12:48.115 INFO Ftp(1) Command: SIZE .
2011-11-02 16:12:48.164 INFO Ftp(1) Response: 200 256.
2011-11-02 16:12:48.165 INFO Ftp(1) Command: MDTM .
2011-11-02 16:12:48.220 INFO Ftp(1) Response: 550 Mailbox Not Found.
2011-11-02 16:12:48.220 INFO Ftp(1) Command: MDTM output
2011-11-02 16:12:48.327 INFO Ftp(1) Response: 213 20111101210300
2011-11-02 16:12:48.328 INFO Ftp(1) Command: SIZE output
2011-11-02 16:12:48.396 INFO Ftp(1) Response: 200 256.
2011-11-02 16:12:48.431 ERROR Ftp(1) Info: Rebex.Net.FtpException: Unable to parse server response to SIZE command.
   at wWGvS.CDbthL.IveJUZ(String )
   at Rebex.Net.Ftp.AyBlxCZ(String , Boolean )
   at wWGvS.CnRKLHZ.GetRemoteFileItemInfo(String remotePath, Object expectedRemoteItem)
   at wWGvS.crxgKKZ.CKTDeW(String , Boolean , Boolean , Object )
   at wWGvS.crxgKKZ.CCusdW(Object )
   at wWGvS.crxgKKZ.TransferFiles(Boolean putFile, Object expectedRootItem, CcBEDL pathList, String targetPath, BJXzjV transferOptions, COqSqG existingFileMode)
   at wWGvS.CnRKLHZ.bTGgmEZ(String , String , FtpBatchTransferOptions , FtpActionOnExistingFiles )
   at Rebex.Net.Ftp.GetFiles(String remotePath, String localDirectoryPath, FtpBatchTransferOptions transferOptions, FtpActionOnExistingFiles existingFileMode)

What is causing GetFiles to run a SIZE command, and is there anyway to prevent it from happening?

asked 02 Nov '11, 17:08

RobertM's gravatar image

RobertM
151
accept rate: 0%

edited 02 Nov '11, 22:26

Could you please submit the communication log as described at http://www.rebex.net/kb/logging.aspx? Editing your question or sending it to support@rebex.net would help us determine the source of this error.

(02 Nov '11, 20:37) Lukas Matyska ♦♦

Thanks for the log!

The dot character ('.') at the end of server's SIZE response is causing the error:

2011-11-02 16:12:48.115 INFO Ftp(1) Command: SIZE . 2011-11-02 16:12:48.164 INFO Ftp(1) Response: 200 256.

This particular SIZE command was issued as a part of a detection routine that tries to determine whether SIZE works for directories at this server or not (to see whether it can be used to distinguish files from directories). This is the first time we have seen such response and it seems to be a bug in the server - RFC 3659 clearly defines the syntax without a dot.

We can easily make Rebex FTP ignore the dot, but will have to make a new build first. I will mail you a link when it's ready later today.

link

answered 03 Nov '11, 07:37

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.4k28
accept rate: 31%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×152
×23
×13

Asked: 02 Nov '11, 17:08

Seen: 257 times

Last updated: 03 Nov '11, 07:37