Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4k views
in .NET FTP by (200 points)
I'm transferring what amounts to a CSV file (comma delimited text) from a Win2k box to an OpenVMS server. During the transfer, it appears to be stripping out the carriage return (or linefeed?). The text in the file no longer breaks at the end of the lines. Here's the c# code used to transfer the file:

   FTPClient ftp = new FTPClient();
   ftp.RemoteHost = server;
   ftp.Connect();
   ftp.Login(user, pwd);
   ftp.ChDir(site);

   ftp.ControlEncoding = System.Text.Encoding.ASCII;
   ftp.TransferType = FTPTransferType.ASCII;
   ftp.Put(selectedFile, remoteFile);

   ftp.Quit();


Can someone please tell me what I'm doing wrong/missing?

I've tried the following encoding - UTF7, UTF8, ASCII, Default. Many thanks in advance.

3 Answers

0 votes
by (162k points)
So when you view the file on VMS it no longer has end of line breaks?

Do you know what (if any) end of line breaks the transferred file has?

VMS systems support a wide variety of text files, depending on the RMS record format (RFM) - i.e. there are a variety of end of line breaks possible.

What happens when you use ftp.exe to transfer the same file?
0 votes
by (200 points)
ftp.exe appears to work just fine.

Using ftp.exe as a test, I put the file, and then immediately get the file (still using ftp.exe). When I inspect the retrieved file (in NotePad), it's fine.

When I use your code, I put the file from my application, and then use FileZilla to retrieve it. When I view the retrieved file (in NotePad) it looks like all of the cr/lf have been stripped. When we look at the file under OpenVMS, it also looks like all the cr/fl have been stripped.

I looked at your code (the FTPClient.PutASCII() method), and at first blush, I don't see anything wrong with the way you're doing it, so I'm kind of at a loss as to what's happening.
0 votes
by (200 points)
Nevermind. the VMS guys were on crack. :)

Categories

...