|
Hi, 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 |
|
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?
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
(30 Aug '10, 11:38)
Andy
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 <cr><lf> end-of-line sequences are converted to <lf>, which means the size will decrease by 1 byte for each line.
(30 Aug '10, 15:13)
Lukas Pokorny ♦♦
An alternative would be to do the "<cr><lf> to <lf>" conversion yourself at the client prior to binary (not ASCII) upload of the converted text. That way, comparing the file size would be possible.
(30 Aug '10, 15:15)
Lukas Pokorny ♦♦
|