What happens to a file when the connection through SFTP is interrupted?
-
22-08-2019 - |
Question
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?
Solution
Short Answer: The part of the file already transferred is lost/garbage collected/marked for deletion
OTHER TIPS
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.