Skip to content

"Checking this file with your organizations's security policies..." in Chrome prevents pickFiles #1915

@dcharkes

Description

@dcharkes

With security policies the file uploads don't work.

Image
    final result = await FilePicker.platform.pickFiles(
      type: FileType.custom,
      allowedExtensions: ['json'],
      withData: true,
    );
    // result returns `null` _before_ the dialog in the browser disappears.

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
MacOS, in the Chrome browser.

How are you picking?

    final result = await FilePicker.platform.pickFiles(
      type: FileType.custom,
      allowedExtensions: ['json'],
      withData: true,
    );

Details to reproduce the issue
Write a Flutter app and run it with flutter run -d chrome.

The app functions correctly on Firefox.

And uploading the file in other UIs works fine after after the securities dialog disappears.

Error Log

$ flutter run -d chrome
This application is not configured to build on the web.
To add web support to a project, run `flutter create .`.
Launching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...              9.2s

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

This app is linked to the debug service: ws://127.0.0.1:49175/uijiThBbEKY=/ws
Debug service listening on ws://127.0.0.1:49175/uijiThBbEKY=/ws
A Dart VM Service on Chrome is available at: http://127.0.0.1:49175/uijiThBbEKY=
The Flutter DevTools debugger and profiler on Chrome is available at:
http://127.0.0.1:49175/uijiThBbEKY=/devtools/?uri=ws://127.0.0.1:49175/uijiThBbEKY=/ws
Starting application from main method in: org-dartlang-app:/web_entrypoint.dart.
A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener.
See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages
to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html
A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener.
See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages
to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html

Browser console:

DDC is about to load 1/2 scripts with pool size = 1000
ddc_module_loader.js:1015 DDC is about to load 736/736 scripts with pool size = 1000
 This app is linked to the debug service: ws://127.0.0.1:49175/uijiThBbEKY=/ws
ddc_module_loader.js:1583 Starting application from main method in: org-dartlang-app:/web_entrypoint.dart.
dom.dart:189 A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html
DomConsole$124warn @ dom.dart:189
(anonymous) @ dom.dart:189
(anonymous) @ channel_buffers.dart:138
push @ channel_buffers.dart:146
invokeOnPlatformMessage @ platform_dispatcher.dart:418
[_setAppLifecycleState] @ platform_dispatcher.dart:1190
tear @ operations.dart:118
onAppLifecycleStateChange @ app_lifecycle_state.dart:50
(anonymous) @ app_lifecycle_state.dart:94
runUnary @ zone.dart:962
(anonymous) @ zone.dart:917
_callDartFunctionFast1 @ js_allow_interop_patch.dart:224
ret @ js_allow_interop_patch.dart:84Understand this warning
dom.dart:189 A message on the flutter/lifecycle channel was discarded before it could be handled.
This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded:
  https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html

Flutter Version details

$ flutter doctor -v
[✓] Flutter (Channel master, 3.39.0-1.0.pre-238, on macOS 15.7.2 24G325 darwin-arm64, locale en-US) [1,541ms]
    • Flutter version 3.39.0-1.0.pre-238 on channel master at /Users/dacoharkes/src/flutter/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9c6e1e319f (32 hours ago), 2025-11-21 06:58:41 -0500
    • Engine revision 9c6e1e319f
    • Dart version 3.11.0 (build 3.11.0-160.0.dev)
    • DevTools version 2.52.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
      cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1,421ms]
    • Android SDK at /Users/dacoharkes/Library/Android/sdk
    • Emulator version 35.5.10.0 (build_id 13402964) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • ANDROID_HOME = /Users/dacoharkes/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [563ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [6ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (2 available) [5.7s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.7.2 24G325 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 142.0.7444.176
    ! Error: Browsing on the local area network for Daco’s iPhone. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [899ms]
    • All expected network resources are available.

• No issues found!

Additional context

File picker version:

  file_picker:
    dependency: "direct main"
    description:
      name: file_picker
      sha256: "7872545770c277236fd32b022767576c562ba28366204ff1a5628853cf8f2200"
      url: "https://pub.dev"
    source: hosted
    version: "10.3.7"

Metadata

Metadata

Assignees

No one assigned

    Labels

    new issueAn issue that hasn't yet been seen from the maintainer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions