EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Cannot receive ASCII from client

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#14575
Posted: 09/24/2010 14:10:20
by Gregory McCoy (Basic support level)
Joined: 09/24/2010
Posts: 2

Our client, using SFTP Blackbox, is trying to send us files through an automated script. The files are supposed to arrive in ASCII but the ASCII files arrive flagged as Binary. Here's his script with his key obfuscated:

public static Boolean UploadFile(string LocalFile, string RemoteFile, string HostName, int Port, string Username, string Password, bool ASCIIMode )
{
SBUtils.Unit.SetLicenseKey("????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????");
var sftp = new TElSimpleSFTPClient();
sftp.OnKeyValidate += new TSSHKeyValidateEvent(sftpClient_OnKeyValidate);
sftp.Port = Port;
sftp.Username = Username;
sftp.Password = Password;
sftp.Address = HostName;
System.Diagnostics.Debug.WriteLine( string.Format( "sftp.ASCIIMode = {0}", sftp.ASCIIMode));
sftp.ASCIIMode = ASCIIMode;
System.Diagnostics.Debug.WriteLine(string.Format("sftp.ASCIIMode = {0}", sftp.ASCIIMode));
sftp.Open();
System.Diagnostics.Debug.WriteLine(string.Format("sftp.ASCIIMode = {0}", sftp.ASCIIMode));
sftp.ASCIIMode = ASCIIMode;
System.Diagnostics.Debug.WriteLine(string.Format("sftp.ASCIIMode = {0}", sftp.ASCIIMode));
sftp.UploadFile(LocalFile, RemoteFile);
sftp.Close(true);

return true;
}

We don't use your product on our end but our other division does. It is important that we receive these files in ASCII. Is the above enough information to shed light on this issue?

Thanks,
Greg
#14576
Posted: 09/24/2010 14:38:06
by Eugene Mayevski (EldoS Corp.)

1) Please assign the license ticket to your user account before we continue. The ticket itself and the procedure of it's use are specified in the registration e-mail that was sent to you upon license purchase. If it's your client that has a license and executes the code, then it would be better that the client contacts us with his problems.

2) We need some more details to understand the problem:

a) what SFTP server software is used
b) what SFTP protocol version is negotiated.

ASCII mode appeared in SFTP version 4 (by default most servers negotiate version 3 of the protocol) and not all servers support ASCII mode correctly.


Sincerely yours
Eugene Mayevski
#14577
Posted: 09/24/2010 14:43:50
by Ken Ivanov (EldoS Corp.)

Besides,

c) could you please clarify what do you mean by "flagged as Binary"?
#14578
Posted: 09/24/2010 14:54:50
by Gregory McCoy (Basic support level)
Joined: 09/24/2010
Posts: 2

I have requested that our other division reply to your questions. In the meantime, our Sterling Commerce software has a flag for each file that indicates whether it was received as binary or ascii. When we ftp the file from the server we must pull it in the mode that matches the flag. Thus, if an ascii file is flagged as binary, I cannot pull it with the mode set to ascii...i must pull it as binary.

Note that our other division can manually send an ascii file to our server and it is flagged as ascii. It is only through the script that it always comes as binary. Joe will be responding to you soon...

...and thanks for your prompt reply.

Greg
#14580
Posted: 09/24/2010 15:20:25
by Joe Fromm (Basic support level)
Joined: 09/24/2010
Posts: 2

a) the SFTP server software is Sterling Commerce CONNECT:Enterprise
b) I don't know how to tell what version of the protocol is negotiated. I have tried setting the Versions property to 112 to require version 4 or higher, but when I do that I fail to connect with a 103 error.

I'm happy to register the license for my software, but I think the only email I have is the purchase receipt.
#14581
Posted: 09/24/2010 15:27:22
by Joe Fromm (Basic support level)
Joined: 09/24/2010
Posts: 2

Sorry, did some more reading and figured out that I can check the Version property to determine the negotiated protocol.

Version = 8, which I believe mean SFTP protocal version 3.
#14584
Posted: 09/24/2010 23:42:30
by Eugene Mayevski (EldoS Corp.)

As said, version 3 doesn't support ASCII transfers, and while the client can emulate ascii transfer by guessing the server OS and performing decoding, for the server itself the transfer will always be binary.

Also, how does the server determine what mode was used to do the transfer? Depending on this there can be different approaches to solving the problem.

Quote

Note that our other division can manually send an ascii file to our server and it is flagged as ascii. It is only through the script that it always comes as binary.


Can you please clarify, what "manually" and "through the script" are and what the difference is? What software is used in each case?


Quote

I'm happy to register the license for my software, but I think the only email I have is the purchase receipt.


I'll move that part of the question to HelpDesk.


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.

Reply

Statistics

Topic viewed 2238 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!