I am using Rebex to download an EDI File off of a FTP site. It is a standard FTP site, not SFTP or FTPS.
When I download the file, the local file is gibberish, like it is encrypted or something.
However if I download the file from the FTP using a client such as FileZilla the file is plain text as it should be.
Text of File should look something like this:
ISA*00* 00 *11*XX0XQ933P *ZZ*6750 *110207*0536*U*00400*000000214*0*P*>\
Instead it looks like this: ÉâÁ\ðð\@@@@@@@@@@\ðð\@@@@@@@@@@\ññ\×Óðñøôùóó×@@@@@\éé\öñôð@@@@@@@@@@@\ññðòð÷\ðõóö\ä\ððôðð\ððððððòñô\ð\×\nàÇâ\âÃ\óñøööòñðôð\
Here is sample code:
private static void FtpDownloadFile(string hostName, int port,
string username, string password, string initialDirectoryName,
string downloadDirectoryPath, string fileName)
{
//create download directory if it does not exist
if (!Directory.Exists(downloadDirectoryPath))
{
Directory.CreateDirectory(downloadDirectoryPath);
}
if (!string.IsNullOrEmpty(fileName))
{
initialDirectoryName += "/" + fileName;
downloadDirectoryPath += "\\" + fileName;
}
//connect to SSH FTP
Rebex.Net.Ftp client = null;
client = new Rebex.Net.Ftp();
client.Connect(hostName, port);
client.Login(username, password);
client.GetFile(initialDirectoryName, downloadDirectoryPath);
//disconnect
client.Disconnect();
}