SFTP Upload in “ASCII” Mode

后端 未结 3 1741
-上瘾入骨i
-上瘾入骨i 2021-01-24 08:49

I have a simple text file that I am uploading from a windows platform to a Unix server using SFTP (Client: FireFTP). I have noticed that when uploading using SFTP rather than pl

3条回答
  •  猫巷女王i
    2021-01-24 09:27

    The Firezilla wiki has a page on technical specifications. The most widely implemented version of the SFTP spec is version 3 draft 2. Notably, the Openssh SFTP client and server implement that version of the spec.

    Version 3 of the SFTP protocol doesn't have a feature equivalent to FTP's ASCII transfer mode. It always transfers files verbatim.

    Later versions of the SFTP protocol support transfer modes that convert line terminator characters. Hypothetically, you could find a client and server that supports the feature.

    Is this a matter of what SFTP protocol version the client is using...?

    I don't know FireFTP's capabilities. But the OpenSSH SFTP server doesn't support an ASCII-like transfer mode.

    is it simply "accepted" that when transferring a file from Windows -> Unix that you will have the additional CR (^M) leftover...

    There are various ways of dealing with the issue. There are programs to convert from one format to another. Some programs that read text files will tolerate line terminators in either format.

提交回复
热议问题