Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DownloadDataType Binary value ignored on ASCII-configured FTP servers #318

Closed
Foustian opened this issue Jul 25, 2018 · 7 comments

Comments

Projects
None yet
3 participants
@Foustian
Copy link

commented Jul 25, 2018

FTP OS: Unknown

FTP Server: Unknown

Computer OS: Windows 10

When working with an FTP server that is configured in ASCII mode by default, the default DownloadDataType value of Binary is not respected. I attached two log files. Both show the trace of a DownloadFile call followed by a GetFileSize call, where DownloadDataType is set to Binary.

BINARY_Log.txt - Run against a server configured as binary. Everything works fine.
ASCII_Log.txt - Run against a server configured as ASCII. The supplied Binary data type is ignored, causing the GetFileSize call to fail.

This seems to be a result of the fact that the FtpClient_LowLevel.SetDataType() method checks to see if the supplied data type has changed from its previous value. Since the default is Binary, it hasn't, so the "Type I" command is never sent to the server. Currently I'm getting around this by executing that command manually before calling DownloadFile.

@mesposito2

This comment has been minimized.

Copy link

commented Aug 1, 2018

Foustain - great question - I think have the same problem accept the other way around. I am connecting to a Binary FTP server - and no matter what I do I can't get the software to issue a TYPE A command. I am sort of a newbie to this stuff - how did you manually send the Type 1 command before the downloadfile - can you post a snippet. Thanks in advance

@Foustian

This comment has been minimized.

Copy link
Author

commented Aug 1, 2018

FtpClient.Execute("TYPE A")

@mesposito2

This comment has been minimized.

Copy link

commented Aug 1, 2018

Awesome thank you....

@robinrodricks

This comment has been minimized.

Copy link
Owner

commented Aug 24, 2018

@Foustian that was an optimization that apparently went wrong. What should happen here, TYPE should be sent before every transfer? Can you elaborate because this is a high priority issue.

Also, when you say server was configured for ASCII what do you mean? Thanks for the detailed description and logs.

@Foustian

This comment has been minimized.

Copy link
Author

commented Aug 24, 2018

I don't really know the technical details of the servers I was testing with. I just know that one ran commands as ASCII and the other ran them as binary by default. I figured there had to be some difference in their configuration that caused that.

As for what should happen, it seems like TYPE should be sent at the start of every connection at least. Unless there's some way to determine if the server has already been set to whatever mode the user has specified. Otherwise if the server runs as ASCII, any call of GetFileSize is going to fail and DownloadFile is going to return corrupted data. Those are the only methods I use, so I'm not sure what else might be affected.

I hope that's helpful. I'm not very familiar with FTP.

@robinrodricks

This comment has been minimized.

Copy link
Owner

commented Jan 17, 2019

Fixed in FluentFTP 19.2.3.

Please check if it works in your use case.

@robinrodricks

This comment has been minimized.

Copy link
Owner

commented Mar 21, 2019

Please reply if you still have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.