Back to blog

How to Read File Contents via Zapier

Read CSV, JSON, and text files from SFTP/FTP/S3 directly in Zapier with PushFTP.

·5 min read

Reading Files vs. Downloading Files

There's an important distinction: downloading a file gives you the file itself (to forward, store, or attach). Reading a file gives you its text content — the actual data inside. When you need to parse a CSV, extract JSON fields, or process text data within Zapier, you want Read File.

PushFTP's Read File action connects to your server from a fixed IP address, retrieves the file content, and returns it as text that Zapier can work with in subsequent steps.

What You Need

  • A PushFTP account with a connection (sign up free)
  • PushFTP's static IP whitelisted on your server
  • A Zapier account
  • A text-based file on your server (CSV, JSON, XML, TXT, etc.)

Step 1: Pick Your Trigger

What tells your Zap to read the file?

New file arrives:

Trigger: PushFTP → New File Detected
Watched Folder: /exports/

On a schedule:

Trigger: Schedule → Every Day at 6am

From another app:

Trigger: Gmail → New Email (containing a report notification)

Step 2: Add the Read File Action

  1. App: PushFTP
  2. Event: Read File
  3. Account: Your PushFTP account

Configure it:

Connection: My SFTP Server
Remote Path: /exports/daily-report.csv

Or map the path dynamically from a trigger:

Remote Path: {{path}} (from New File Detected trigger)

The action returns the file's text content as a string. For a CSV, you'll get something like:

name,email,amount
Alice,[email protected],150.00
Bob,[email protected],275.50
Carol,[email protected],89.99

Step 3: Parse the Content

Now the useful part — doing something with the data.

CSV Files

Zapier has built-in CSV parsing. After the Read File step, add:

App: Formatter by Zapier
Event: Utilities → Line Items from CSV
Input: {{file_content from Read File step}}

This splits the CSV into individual rows that you can loop through or use in subsequent steps. Each column becomes a mappable field.

JSON Files

For JSON content, use Zapier's Code step:

const data = JSON.parse(inputData.content);
return {
  total: data.summary.total,
  count: data.items.length,
  firstItem: data.items[0].name
};

Map {{file_content}} from the Read File step into inputData.content.

Plain Text

For simple text files (logs, configs, single-value files), the content is directly usable. Map it into any text field in your next action:

Email body: The latest reading is: {{file_content}}

Real-World Workflows

Daily CSV Report to Google Sheets

Trigger: Schedule → Every Day at 7am
Action 1: PushFTP → Read File
  Path: /exports/daily-sales.csv
Action 2: Formatter → Line Items from CSV
Action 3: Google Sheets → Create Rows (loop)
Action 4: PushFTP → Move File
  To: /archive/daily-sales-{date}.csv

This reads the CSV, parses it, adds each row to a spreadsheet, and archives the original file. Check the getting started guide if you need help setting up connections.

JSON Config Check

Trigger: Schedule → Every Hour
Action 1: PushFTP → Read File
  Path: /config/settings.json
Action 2: Code by Zapier → Parse JSON
Action 3: Filter → Only continue if status ≠ "healthy"
Action 4: Gmail → Send Alert Email

Monitor a remote config file and alert when something changes.

Log Tail for Error Detection

Trigger: Schedule → Every 15 minutes
Action 1: PushFTP → Read File
  Path: /logs/app.log
Action 2: Filter → Only continue if content contains "ERROR"
Action 3: Webhooks → POST to incident tracker

Simple log monitoring without SSH access. Note: this reads the entire file each time, so it works best for log files that rotate frequently.

File Size Considerations

Read File returns the entire file content as text. This works well for files under a few MB. For larger files:

  • CSV files >5MB — consider splitting them on the server side first
  • Binary files — Read File is for text. Use Download File for images, PDFs, ZIP files
  • Very long files — Zapier has field size limits. If the content exceeds them, the data may be truncated

For large data sets, the PushFTP REST API gives you more control over how much data you retrieve.

Reading From S3

Same action, different connection. Select your S3 connection and specify the object key:

Connection: My S3 Bucket
Remote Path: data/2025/01/report.json

PushFTP handles the protocol differences. Your Zap stays the same whether you're reading from SFTP, FTP, or S3 — all through the same fixed IP.

Reading file contents directly in Zapier opens up workflows that were previously impossible without custom code. Parse CSVs, extract JSON, process text — all from your SFTP server through a single fixed IP.

FAQ

Can I read binary files like PDFs or images?

Read File is designed for text content (CSV, JSON, XML, TXT, logs). For binary files, use Download File instead, which returns the file as a downloadable URL for forwarding or storage.

What encoding does Read File support?

PushFTP returns content as UTF-8 text. If your file uses a different encoding, you may see garbled characters. Convert the file to UTF-8 on the server side, or use a Zapier Code step to handle encoding conversion.

Can I read just part of a file?

Read File returns the entire file content. There's no built-in way to read specific lines or byte ranges through Zapier. If you need partial reads, use PushFTP's REST API or add a Code step in Zapier to extract the portion you need from the full content.

What happens if the file doesn't exist?

The action fails with an error. To handle this gracefully, add a Find File step before Read File and use a Zapier filter to only continue if the file exists.

From Data to Action

Reading file contents turns your SFTP server from a storage box into a data source. CSV exports become spreadsheet rows. JSON configs become monitoring inputs. Log files become alerting triggers. PushFTP's Read File action is the bridge between files sitting on a server and workflows that act on their content.

Ready to automate your file transfers?

Connect to any SFTP, FTP, or S3 server from a fixed IP address. Free plan available — no credit card required.