当 SFTP 连接中断时文件会发生什么情况?
我需要实现从 Web 服务器到 SFTP 服务器的文件传输。 当文件传输过程中连接中断时,已经传输的字节会怎样?
I need to implement a file transferring from a web server to a SFTP server. When the connection is interrupted during the file transferring, what happens to the bytes already transferred?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简短回答:已传输的文件部分丢失/垃圾收集/标记为删除
Short Answer: The part of the file already transferred is lost/garbage collected/marked for deletion
除非 SFTP 服务器具有恢复中断传输的内置功能(不确定是否存在,如果存在则可能是一个插件),否则文件根本不会被传输。
Unless the SFTP server has built-in capabilities to resume an interrupted transfer (not sure if this exists, if it does it would probably be an addon), the file will not be transferred at all.
最可能的情况是服务器上现在存在部分传输的文件。
很少有服务器会将此类文件标记为删除 - 这意味着您永远无法恢复损坏的传输,而必须从头开始。
The most likely scenario is that a partially transferred file will now exist on the server.
Few servers would mark such a file for deletion - it would mean that you could never resume a broken transfer, but would have to start again from scratch.