Closed Vignesh-dev12 closed 4 days 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
@Vignesh-dev12 did you try with "file_selector" flutter package ? https://pub.dev/packages/file_selector
@ysimonx Yes, I tried using the package you mentioned, I couldn't get the mime type
Hi guys, I got the same error, my temporary workaround was to get the mimeType manually based on the extension: heres what I did, hope it helps!
String _getMimeType(String extension) {
switch (extension) {
case 'doc':
return 'application/msword';
case 'docx':
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
case 'pdf':
return 'application/pdf';
case 'jpg':
return 'image/jpeg';
case 'png':
return 'image/png';
default:
return 'application/octet-stream';
}
}
Hi @josephchipock and @Vignesh-dev12 : there is also https://pub.dev/packages/mime
@ysimonx even better, I'll try implement that, thnx
This issue is stale because it has been open for 7 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
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 valuePlatform : 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.