SiaSia Developer Portal

Download to a File

Stream decrypted bytes directly to disk instead of buffering in memory.

rust
use sia_storage::DownloadOptions; let mut file = tokio::fs::File::create("output.bin").await?; let mut reader = sdk.download(&obj, DownloadOptions::default())?; tokio::io::copy(&mut reader, &mut file).await?;