file_picker_web

4.2.0

Web platform implementation of the file_picker plugin, providing browser file selection, file streaming, and file loading.

Download archive

Readme

File Picker for Web

file_picker_web

The Web implementation of file_picker.

Usage

This package is endorsed, which means you can simply use file_picker as normal, and the Web implementation will be automatically included.

Changelog

4.2.0

  • Added FilePickerWebOptions.saveMode. WebSaveFileMode.dialog saves through the browser's save dialog, and supportsShowSaveFileDialog tells whether the browser supports it. #1732

4.1.0

  • readAsByteStream() now always emits evenly sized chunks of WebPlatformFile.streamChunkSize (1 MiB), except the last one, with or without withReadStream. With withReadStream the chunks used to be 1,000,000 bytes. #2223
  • Deprecated withData, withReadStream and readSequential in FilePickerWebOptions. Picked files are read on demand by readAsBytes() and readAsByteStream(). They will be removed in the next major version.

4.0.1

  • Fixed picking files on Safari (macOS and iOS) never returning the selection. #2222
  • Fixed a selection being reported as cancelled when the window regained focus before the change event.
  • Fixed readAsBytes() and readAsByteStream() hiding read failures. A failed stream now emits an error instead of ending early with a truncated file. #2229
  • Fixed picking files larger than 2 GB on web with the default options. #2223
  • An empty picked file now also gets a valid blob: URL instead of an empty one.
  • Fixed pickFiles()/pickFile() never completing when processing the picked files failed.

4.0.0

  • BREAKING CHANGE: PlatformFile.length() now returns Future<int?> instead of Future<int>. Returns null when the length could not be determined (e.g. a failed disk read), instead of 0, matching lengthSync(). #2197
  • Fixed FilePickerWebOptions.readSequential having no effect. Files are now genuinely read one at a time when true, and concurrently (the default) when false, preserving selection order in the result either way. #2206

3.1.0

  • Implemented PlatformFile.lengthSync(), returning the browser's File.size (or the loaded bytes' length) synchronously, without doing any I/O.

3.0.3

  • Tightened the file_picker_platform_interface lower bound to ^3.2.0. This package's pickFile()/pickFiles() signatures reference DarwinOptions, added in that version, so resolving against an older one would fail to compile.

3.0.2

  • Fixed the window focus listener used to detect a cancelled picker dialog never being removed after use. removeEventListener was passed a freshly created .toJS function object on every call, which never matches the one originally passed to addEventListener, so the listener leaked on window on every pickFiles/pickFile call. The JS function references are now cached and reused for both add and remove.

3.0.1

  • Improved package description, added example, and added missing API documentation.

3.0.0

  • Unified Web platform release for federated file_picker architecture using package:web and dart:js_interop.

2.0.0

  • Deprecates plugin in favor of standalone file_picker for all platforms.

1.0.2+1

  • Fix custom filter String creation.

1.0.2

  • Addresses an issue that would cause dot being required on filters for web (#343).

1.0.1+2

  • Bumps file_picker_platform_interface dependency version.

1.0.1+1

  • Updates homepage & description.

1.0.1

  • Updates API to support onFileLoading from FilePickerInterface.

1.0.0

  • Adds public API documentation and updates file_picker_platform_interface dependency.

0.0.2

  • Added no-op iOS podspec to prevent build issues on iOS.

0.0.1

  • Creation of File Picker Web project draft.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add file_picker_web
pubspec.yaml
name: file_picker_web
description: Web platform implementation of the file_picker plugin, providing browser file selection, file streaming, and file loading.
version: 4.2.0
homepage: https://github.com/vicajilau/flutter_file_picker/tree/main/packages/file_picker_web
repository: https://github.com/vicajilau/flutter_file_picker/tree/main/packages/file_picker_web
topics:
  - file-picker
  - web

resolution: workspace

environment:
  sdk: ">=3.10.0 <4.0.0"
  flutter: ">=3.38.0"

flutter:
  plugin:
    implements: file_picker
    platforms:
      web:
        pluginClass: FilePickerWeb
        fileName: file_picker_web.dart

dependencies:
  flutter:
    sdk: flutter
  flutter_web_plugins:
    sdk: flutter
  file_picker_platform_interface: ^4.0.0
  cross_file: ^0.3.5+4
  meta: ^1.17.0
  path: ^1.9.1
  web: ^1.1.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^6.0.0

Version history

VersionPublishedArchiveSHA-256
0.0.1On demandDownload62d29b11…f2cba9
0.0.2On demandDownload32f9b4fb…257ecf
1.0.0On demandDownload0b42443e…9bfa16
1.0.1On demandDownload67de945d…eb53b2
1.0.1+1On demandDownload93a58ac6…71fbe0
1.0.1+2On demandDownloada5949974…351e83
1.0.2On demandDownload3933720f…13a1cf
1.0.2+1On demandDownloada1f762cc…476653
2.0.0On demandDownload8adec268…771aba
3.0.0On demandDownload3c0d7366…953d96
3.0.1On demandDownloadf1af38b3…aa7eed
3.0.2On demandDownload067051c4…1106f3
3.0.3On demandDownloaddf472142…f8750b
3.1.0On demandDownload935560a9…06f227
4.0.0On demandDownloadb3004268…ef3496
4.0.1On demandDownload8d69eb18…c8775e
4.1.0On demandDownload32af8262…d59b7d
4.2.0Cached · Upstream SHA-256 matchedDownloada2288008…6c8b8c

Dependencies

cross_file "^0.3.5+4"

file_picker_platform_interface "^4.0.0"

flutter { "sdk": "flutter" }

flutter_web_plugins { "sdk": "flutter" }

meta "^1.17.0"

path "^1.9.1"

web "^1.1.1"