How to transfer binary file in SFTP?

瘦欲@ 提交于 2020-01-23 06:44:26

问题


How to transfer binary file in SFTP? Will it be same as normal file? Or is there any different process?


回答1:


A binary file is a normal file.

You are possibly referring to a text/ascii vs. a binary transfer mode, known from an FTP protocol. The FTP protocol defaults to the text/ascii mode, so one usually had to ensure that the mode was switched to the binary not to corrupt the transferred binary files.

SFTP protocol also supports a text/ascii vs. binary mode distinction in its newer versions. Though contrary to the FTP, the binary mode is the default and one has to explicitly force the text/ascii mode, if desired.

Moreover the ascii/text mode is supported by an SFTP version 4 and newer only. And many SFTP servers/clients (including the most widespread one, the OpenSSH) support an SFTP version 3 only. So they will not even let you use the text/ascii mode.



来源:https://stackoverflow.com/questions/29226647/how-to-transfer-binary-file-in-sftp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!