I have been using the dotNet libraries to develop an "EDI over SFTP" connection with a customer.
When I upload files using the WinSCP software, all is OK. When I use the dotNet library, copying the code taken from the Session info in WinSCP, all seems OK on my side - the files upload OK - but the customer claims it does not generate a unique 'External Document Id' (he calls it a SNRF, not sure if that means anything but they are French so could be French abbreviation).
I have attached the information received from the client. When using the WinSCP software, he gets a unique External Document Id (as per the top screen shot, even though he's highlighted Internal Document Id!).
When using the DotNet library, the 'External Document Id' is set to "Upload" (as per lower screen shot), which is the name of the sub-folder that the source file was in on our side prior to upload.
The code on our side is pretty simple:
opts = new SessionOptions()
{
Protocol = Protocol.Sftp,
HostName = "**removed**",
UserName = "**removed**",
Password =
SshHostKeyFingerprint = "**removed**
};
RemoteFolder = @"/**removed**/**removed**/*BIN/" ;
WinSCPsession = new Session();
WinSCPsession.Open(sessionOptions);
TransferOptions transferOptions = new TransferOptions()
{
FileMask = “*.*”,
TransferMode = TransferMode.Binary,
};
TransferOperationResult transferResult = WinSCPsession.PutFiles(LocalFolder, RemoteFolder, false, transferOptions);
// Throw on any error
transferResult.Check();
I guess I'm missing something in the TransferOptions settings, so any suggestions on how I get my DotNet code to act in the same way as the WinSCP software would be very much appreciated. Thanks.