Skip to content

Missing File Extension When Picking Files from Google Drive on Android #1919

@SasikumarChinnasamy

Description

@SasikumarChinnasamy

Before creating an issue, make sure that you are on the latest file_picker version and that there aren't already any similar opened inssues. Also, check if it isn't described on the Wiki, specially on Troubleshooting page.

Also, sometimes a simple flutter clean and flutter build again with latest file_picker version, may end up by fixing cached issues, so I encourage you to first do so.

Describe the bug

When selecting files directly from Google Drive on Android using the file_picker package, the file extension information is missing from the PlatformFile result. The extension field contains only the filename without the actual file extension type.

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
Android - 16

How are you picking?

 final result = await FilePicker.platform.pickFiles(
      type: FileType.custom,
      allowedExtensions: allowedFileExtensionTypes,
      allowMultiple: true,
    );

Details to reproduce the issue

  1. Open the file picker in the Android app using FilePicker.platform.pickFiles()
  2. Navigate to the Google Drive storage location
  3. Select a file that is stored directly in Google Drive (not synced locally) or rename the uploaded file and manually remove the extension
  4. Examine the PlatformFile result

Error Log
PlatformFile(
bytes: null,
extension: "document_2_Completed", // ❌ Expected: "pdf"
hashCode: 703330730,
identifier: "content://com.google.android.apps.docs.storage/document/abc...",
name: "document_2_Completed", // ❌ Expected: "document_2_Completed.pdf"
path: "/data/user/0/com.boldsign.dev/cache/file_picker/1765200714574/...",
readStream: null,
size: 223765,
xFile: XFile
)

Screenshots and/or video
If applicable, add screenshots or video to help explain your problem.

Flutter Version details
[√] Flutter (Channel stable, 3.38.1, on Microsoft Windows [Version 10.0.26100.7171], locale en-US) [428ms]
• Flutter version 3.38.1 on channel stable at D:\Flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b45fa18946 (4 weeks ago), 2025-11-12 22:09:06 -0600
• Engine revision b5990e5ccc
• Dart version 3.10.0
• DevTools version 2.51.1
• 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

[√] Windows Version (Windows 11 or higher, 24H2, 2009) [2.8s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [5.7s]
• Android SDK at C:\Users\SasikumarChinnasamy\AppData\Local\Android\sdk
• Emulator version 35.5.10.0 (build_id 13402964) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\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.

[√] Chrome - develop for the web [27ms]
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps [25ms]
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components

[√] Connected device (4 available) [893ms]
• SM E156B (mobile) • 192.168.31.34:37665 • android-arm64 • Android 16 (API 36)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.7171]
• Chrome (web) • chrome • web-javascript • Google Chrome 139.0.7258.139
• Edge (web) • edge • web-javascript • Microsoft Edge 142.0.3595.90

[√] Network resources [1,062ms]
• All expected network resources are available.

Additional context
Users must manually rename the file in Google Drive and remove the extension before selecting it through the file picker. [Select the file without extension type]

Image

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