miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.33k stars 664 forks source link

platformFile!.xFile.mimeType returns null in Flutter Web #1617

Open Vignesh-dev12 opened 1 day ago

Vignesh-dev12 commented 1 day ago

Describe the bug I getting null value when I trying to get mimeType in picked file in web

FilePickerResult? result = await FilePicker.platform.pickFiles(); PlatformFile platformFile = result!.files.single; print("mimeType :: ${platformFile.xFile.mimeType}"); // returns null value

Platform : Web

Platform OS version Ubuntu 20.04.6

Details to reproduce the issue Need not null in mimeType value

Plugin Version : 8.1.3

Flutter Version details [!] Flutter (Channel stable, 3.22.0, on Ubuntu 20.04.6 LTS 5.15.0-124-generic, locale en_IN) • Flutter version 3.22.0 on channel stable at /home/vigneshkumarm/flutter-3.19.3/flutter ! The flutter binary is not on your path. Consider adding /home/vigneshkumarm/flutter-3.19.3/flutter/bin to your path. ! The dart binary is not on your path. Consider adding /home/vigneshkumarm/flutter-3.19.3/flutter/bin to your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision 5dcb86f68f (6 months ago), 2024-05-09 07:39:20 -0500 • Engine revision f6344b75dc • Dart version 3.4.0 • DevTools version 2.34.3 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /home/vigneshkumarm/Android/Sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /home/vigneshkumarm/android-studio-2024.1.1.13-linux/android-studio/jbr/bin/java • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) • All Android licenses accepted.

[✓] Chrome - develop for the web • Chrome at google-chrome

[✗] Linux toolchain - develop for Linux desktop ✗ clang++ is required for Linux development. It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/ ✗ CMake is required for Linux development. It is likely available from your distribution (e.g.: apt install cmake), or can be downloaded from https://cmake.org/download/ ✗ ninja is required for Linux development. It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases • pkg-config version 0.29.1 ✗ GTK 3.0 development libraries are required for Linux development. They are likely available from your distribution (e.g.: apt install libgtk-3-dev)

[✓] Android Studio (version 2024.1) • Android Studio at /home/vigneshkumarm/android-studio-2024.1.1.13-linux/android-studio • Flutter plugin version 81.0.2 • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] Android Studio (version 2023.2) • Android Studio at /home/vigneshkumarm/android-studio-2023.2.1.23-linux/android-studio • Flutter plugin version 78.2.2 • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.94.2) • VS Code at /usr/share/code • Flutter extension version 3.94.0

[✓] Connected device (3 available) • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator) • Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.6 LTS 5.15.0-124-generic • Chrome (web) • chrome • web-javascript • Google Chrome 130.0.6723.58

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

! Doctor found issues in 2 categories.

ysimonx commented 10 hours ago

Same here : with Chrome or Edge, same issue, but on a specific windows desktop device only... but, i manage to select the file if i try to rename it while browsing here are 2 videos : one with a null result, and the other one when I manage to select the file

https://github.com/user-attachments/assets/3142d27d-226f-45aa-ab4d-73b78837bf60

https://github.com/user-attachments/assets/baecccef-91f2-4c22-bdf9-e5e09071164a

ysimonx commented 10 hours ago

@Vignesh-dev12 did you try with "file_selector" flutter package ? https://pub.dev/packages/file_selector