如何在 SFTP 中传输二进制文件? [英] How to transfer binary file in SFTP?
问题描述
如何在 SFTP 中传输二进制文件?它会和普通文件一样吗?或者有什么不同的流程?
How to transfer binary file in SFTP? Will it be same as normal file? Or is there any different process?
推荐答案
二进制文件是普通文件.
A binary file is a normal file.
您可能指的是 FTP 协议中已知的文本/ascii 与二进制传输模式.FTP 协议默认为 text/ascii 模式,因此通常必须确保将模式切换为二进制模式,以免损坏传输的二进制文件.
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 协议在其较新版本中还支持文本/ascii 与二进制模式的区别.尽管与 FTP 相反,二进制模式是默认模式,如果需要,必须明确强制使用 text/ascii 模式.
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.
此外,仅 SFTP 版本 4 及更新版本支持 ascii/text 模式.许多 SFTP 服务器/客户端(包括最广泛使用的 OpenSSH)仅支持 SFTP 版本 3.所以他们甚至不会让你使用 text/ascii 模式.
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.
这篇关于如何在 SFTP 中传输二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!