How do I resume an interrupted file transfer with SFTP?
SFTP provides reget and reput for resuming compatible partial downloads and uploads. Resume only when the source file is unchanged and the partial destination belongs to that same file. Otherwise, continuing can produce corrupted content.
Instructions
1. Confirm the source and partial destination
Check that the source filename, content and expected size have not changed since the interrupted transfer. A similarly named replacement is not necessarily the same file.
2. Resume the intended direction
Open an authenticated SFTP session and confirm local and remote directories first. Choose only the command matching your interrupted operation.
reget server-export.dat local-export.datThis resumes a download from the remote source into its corresponding partial local file.
reput local-package.dat server-package.datThis resumes an upload from the unchanged local source into its matching partial remote file.
3. Verify complete content after transfer
Do not treat a resumed progress display as an integrity check.
Get-FileHash -LiteralPath ".\local-export.dat" -Algorithm SHA256For a download, compare this with the source’s trusted SHA256 value. For an upload, compare the remote file hash with the local source.
Check the result
- The completed destination size equals the unchanged source size.
- The completed source and destination SHA256 values match.
Troubleshooting
- The source changed during the interruption
- Do not resume against the old partial copy; use a deliberately chosen fresh destination.
- The resumed hash differs
- Do not use the file. Review source stability and restart the transfer to a verified target.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
