Integrate file feeds with your systems
Pick up files from SFTP, FTP and SMB servers on a schedule, hand each one to a Python service, and connect batch feeds to the databases, queues and APIs that need them.
Tutorials
In-depth API integration tutorial
Learn how to design and build scalable, real-world, production-ready integrations in Python
Modern REST API tutorial
How to design, build and secure REST APIs, and how to offer services to API clients
EDIFACT healthcare messaging
A worked integration where interchange files arrive over a file transfer and leave as typed messages
How to use the file transfer integration
More examples
File transfer in Zato
The two protocols, the two ways to drive them, and which one to reach for
Outgoing SFTP connections
Address, credentials, private keys through environment variables and host key checking
Outgoing SMB connections
Host, port, credentials and share-rooted remote paths
The connection API
One API for both protocols - upload, download, read, write, list and manage remote entries
File transfer schedules
Watch a directory, decide when a file is complete, and pass it to a service
Receiving files in a service
What each invocation delivers and what happens when your service refuses a file
Real-world feeds
Partner drops with marker files, slow uploads, competing consumers and daily batches
File transfer in enmasse
Keep connections and their schedules in YAML under version control
Data mapping
Parse the contents of a file into models and convert between formats
Data models
Describe the structure of a file's contents with Python dataclasses
Configuration
Where to keep directories, patterns and environment-specific settings
About file transfer
Files are still how a great many organizations exchange data with each other. Banks send settlement files, retailers send stock and price lists, hospitals send interchange files, and payroll, logistics and government systems all trade fixed-width and delimited files on timetables that have been in place for decades. Zato connects to the SFTP, FTP and SMB servers that host those feeds, watches the directories they arrive in, and passes each file to a Python service that can validate it, transform it and pass it on to a database, a queue, an API or another file server. The result is that a batch feed becomes an integration like any other, with the same services, the same logging and the same deployment as the rest of your work.
Frequently asked questions
Which protocols does Zato support?
SFTP, FTP, FTPS and SMB, through outgoing SFTP connections, outgoing FTP connections and outgoing SMB connections. All of them share one API, so a service written against one works against the others.
How do I pick up files as they arrive?
Add a file transfer schedule to the connection. It looks into a directory as often as you tell it to and invokes your service once per file.
How does Zato know a file has finished uploading?
Either by watching it stop changing, or by waiting for a marker file the sender puts down when it is done. See schedules for both modes.
What does my service receive?
One file transfer item per file, with the name, the full path, the size, the modification time and the contents.
What happens to a file once it has been processed?
It is either moved to a destination directory of your choosing or deleted, as the schedule says. A file your service refuses is left exactly where it was and comes back on the next run.
Can two servers watch the same directory?
Yes - turn claiming on and each file is renamed before anything reads it, so no two servers ever take the same one. See real-world feeds.
Can I upload and download files from my own code?
Yes - the connection API gives your service the whole remote file system, with no schedule involved.
How do I keep this configuration under version control?
With enmasse. Connections and their schedules live in YAML and are imported into any environment.
Ready to connect your file feeds?
Get started with Zato and build maintainable integrations around the files your partners send.