Treat SFTP delivery as a handoff, not a file appearance
A filename appearing on an SFTP server does not always mean the sender has finished writing it.
- Published
- Updated
- Reading time
- 5 min read
Tested environment Synthetic SFTP directory fixtures with partial files, atomic renames and repeated scans.
Agree on the handoff signal
The cleanest contract writes to a temporary name and renames the complete file into the watched directory. A separate ready file also works when both sides define the pairing rule. Time since last change is weaker and needs real counterpart testing.
Own the file before processing
Move or claim the file so two workers cannot process it independently. Record the original name, size and safe digest with the work record. Keep the payload out of routine logs.
Finish with an explicit outcome
Archive, reject or quarantine the file according to a named rule. Do not leave completed work in the intake directory where the next scan can rediscover it.