Rebex for .Net compact framework (Severity 1 issue)

0 votes
asked Aug 30, 2010 by Andy (120 points)
edited Mar 28, 2011


I am uing rebex ftp for .Net comapct framework.

I am trying to upload and download text files from and to unix ftp server. The file size increases when i upload the files on the unix ftp server.

The method used to upload the files is mobjFtp.PutFiles(local_file_path,remote_file_path)

The FileTransferMode id ASCII.

But also when i try uploading files using binary mode the file size remains the same. But setting the transfer mode to binary adds a control M character at the end of each line in the text file.The unix ftp server filetransfer setting is set to ASCII and can not be changed.

Can anybody help?

Regards, Andy

Applies to: Rebex FTP/SSL

1 Answer

0 votes
answered Aug 30, 2010 by Lukas Pokorny (121,790 points)
edited Aug 30, 2010

First, I would like to state that Rebex FTP and Rebex FTP/SSL doesn't modify the uploaded file data in any way in either ASCII or binary mode - the data is send as-is in both cases.

If you see an additional control M character at the end of each line when you open the file at the Unix server, it most likely represents the character (code 13) that is used as a part of Windows/DOS end-of-line sequence . The character (code 10) is the Unix end-of-line sequences. In binary mode, the original sequences are left intact and many Unix applications can't handle that (some display it as control M or ^M).

Normally, the to conversion is performed by the FTP server when ASCII transfer mode is specified, but this doesn't work ar your server some reason. To make it possible to tell what is going on, would it be possible to do this?

  1. Upload a text file to the server in ASCII mode.
  2. Download this text file from the server in binary mode.
  3. Send us (to both the original text file (before the upload) and the downloaded text file (which was uploaded using ASCII and downloaded using binary). Please send both in a ZIP file to prevent mail servers from modifying them. By comparing the two files, we should be able to tell what is going on.
commented Aug 30, 2010 by Andy (120 points)
Hi, Our requirement is: As soon as we upload the file to ftp server ,we are doing a sanity check by comparing the file size (before upload and after upload). So as we upload the files our sanity check fails due to the mismatch in file size in ASCII mode. Also i am mailing u the files on the support mail Id. Regards, Andy
commented Aug 30, 2010 by Lukas Pokorny (121,790 points)
Hello, in ASCII mode, it is not possible to do this kind of sanity check because the file length will almost always be different. In ASCII mode, the end-of-line sequences are converted to , which means the size will decrease by 1 byte for each line.
commented Aug 30, 2010 by Lukas Pokorny (121,790 points)
An alternative would be to do the " to " conversion yourself at the client prior to binary (not ASCII) upload of the converted text. That way, comparing the file size would be possible.