Skip to content
pubscout

file_saver

0.7.0, released 6 weeks ago by hassanansari.dev

Save files from bytes, paths, streams, and URLs across Android, iOS, Web, Windows, macOS, and Linux.

WASM-ready
$ flutter pub add file_saver
Source repository

What it does

Saves files from bytes, file paths, streams, or network URLs across multiple platforms. Offers methods like saveFile, saveAs, saveToGallery, saveToDownloads, and stream-based downloads.

AI-written summary of version 0.7.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to download or save files from bytes, paths, or URLs on mobile, desktop, or web.
  • You want to trigger save dialogs or save directly to shared folders like Downloads or the photo gallery.

Skip it when

  • You only need to pick files rather than save them.
  • You require complex file management operations beyond saving/downloading.

Strengths

  • Cross-platform support for Android, iOS, Web, Windows, macOS, and Linux.
  • Supports multiple input types including bytes, files, paths, streams, and HTTP links.

Weaknesses

  • Web platform has limitations with large files and the File System Access API depending on the browser.
  • Requires platform-specific configuration for permissions and entitlements on iOS and macOS.

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
5

Requires platform-specific settings like Info.plist keys for iOS and entitlement configurations for macOS.

await FileSaver.instance.saveFile(
  name: "my_document",
  bytes: fileBytes,
  fileExtension: "pdf",
  mimeType: MimeType.pdf,
);

Alternatives

Packages that do the same job and could replace file_saver.

Works with

Packages commonly used together with file_saver: ones it builds on, ones built on it, and its own family.