# Stream file content over FTP

Stream file content over FTP on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

Transferetto

Small PowerShell module with FTPS/SFTP functionality

[View on GitHub](https://github.com/EvotecIT/Transferetto) [Visit Website](#) [Releases](https://github.com/EvotecIT/Transferetto/releases/tag/Transferetto-v2.0.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/Transferetto)

Stars**93**

Forks**18**

Open issues**0**

PowerShell Gallery downloads**14067470**

Release**v2.0.4**

Language: C# Updated: 2026-11-17

Curated Examples

Use Transferetto to write and read remote FTP content through managed streams.

This pattern is useful when a script should work with remote content incrementally instead of forcing a whole-file upload or download step first.

It is adapted from the source example at `Examples/Example22-FTPStream.ps1`.

## When to use this pattern

- You want to write or read content in chunks.
- The remote file may be inspected before downloading the whole thing.
- A streaming workflow is more natural than a file-based workflow.

## Example

```powershell
Import-Module Transferetto

$ftpClient = Connect-FTP -Server 'ftp.example.com' -Credential (Get-Credential)

$writeStream = Open-FTPStream -Client $ftpClient -RemotePath '/incoming/ftp-stream-demo.txt' -Mode Write
Write-FTPStream -StreamSession $writeStream -Text "first line`n"
Write-FTPStream -StreamSession $writeStream -Text "second line`n"
Sync-FTPStream -StreamSession $writeStream
Close-FTPStream -StreamSession $writeStream

$readStream = Open-FTPStream -Client $ftpClient -RemotePath '/incoming/ftp-stream-demo.txt' -Mode Read
$chunk = Read-FTPStream -StreamSession $readStream -Count 64 -AsText
$chunk

Close-FTPStream -StreamSession $readStream
Disconnect-FTP -Client $ftpClient
```

## What this demonstrates

- opening a managed FTP write stream
- syncing the remote stream explicitly before closing it
- opening a second stream to read remote content back as text

## Source

- [Example22-FTPStream.ps1](https://github.com/EvotecIT/Transferetto/blob/master/Examples/Example22-FTPStream.ps1)

<!-- PowerForge markdown artifact sha256:58F3B4CB89B64748D24A3064DA063A68BBFA2033FA8334AC1015C0B242EFEBD3 -->
