Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileName and Path is showing null #62

Closed
prasant10050 opened this issue Mar 27, 2019 · 35 comments
Closed

FileName and Path is showing null #62

prasant10050 opened this issue Mar 27, 2019 · 35 comments
Labels
bug Something isn't working triage Further information is requested
Milestone

Comments

@prasant10050
Copy link

_openFileExplorer() async {
if (_pickingType != FileType.CUSTOM || _hasValidMime) {
try {
if (_multiPick) {
_path = null;
_paths = await FilePicker.getMultiFilePath(type: _pickingType, fileExtension: _extension);
} else {
_paths = null;
_path = await FilePicker.getFilePath(type: _pickingType, fileExtension: _extension);
}
} on PlatformException catch (e) {
print("Unsupported operation" + e.toString());
}
if (!mounted) return;

  setState(() {
    _fileName = _path != null ? _path.split('/').last : _paths != null ? _paths.keys.toString() : '...';
  });
  File file=new File(_path);
  print("Path $file");
  print("FileName $_fileName");
  print(lookupMimeType(_path));
}

}

I/FilePicker(11562): [SingleFilePick] File URI:content://com.android.providers.downloads.documents/document/235
E/FilePickerUtils(11562): Getting for API 19 or abovecontent://com.android.providers.downloads.documents/document/235
E/FilePickerUtils(11562): Document URI
E/FilePickerUtils(11562): Downloads External Document URI
E/FilePickerUtils(11562): Something went wrong while retrieving document path: java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/235
E/FilePickerUtils(11562): Something went wrong while retrieving document path: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/235 from pid=11562, uid=10292 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()
I/FilePickerUtils(11562): Remote file loaded and cached at:/data/user/0/com.cbtech.cb_curemantra/cache/null
I/FilePicker(11562): Absolute file path:/data/user/0/com.cbtech.cb_curemantra/cache/null
I/flutter (11562): Path File: '/data/user/0/com.cbtech.cb_curemantra/cache/null'
I/flutter (11562): FileName null
V/PhoneWindow(11562): DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@5e1c312, this = DecorView@c7bbae3[MainActivity]
D/Surface (11562): Surface::connect(this=0x75f615a000,api=1)
D/mali_winsys(11562): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
D/Surface (11562): Surface::connect(this=0x75f615b000,api=1)
D/mali_winsys(11562): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
I/flutter (11562): null

@prasant10050
Copy link
Author

its urgent, anyone can fix this issue.

@miguelpruivo
Copy link
Owner

@prasant10050 I may take a look into it tomorrow, but at a first glance it looks like you don’t gave the right permissions.

What are the steps to reproduce this?

@prasant10050
Copy link
Author

prasant10050 commented Mar 28, 2019 via email

@prasant10050
Copy link
Author

prasant10050 commented Mar 28, 2019 via email

@miguelpruivo
Copy link
Owner

I need further information on this. Do you have both given permissions in runtime and manifest file?

Have you tried to clean your project, add file_picker: 1.3.3 and then rebuild and see if it is working for you? If not, can you post step by step what you are doing and also the output of flutter doctor -v?

Thank you.

@miguelpruivo miguelpruivo added triage Further information is requested on hold labels Mar 29, 2019
@miguelpruivo
Copy link
Owner

@prasant10050 this will be closed due to no further info. Feel free to re-open it with more details. Thank you.

@Peltoche
Copy link

Peltoche commented Jun 2, 2019

Hi,

I'm workink with the version ^1.3.5 and it seems that the issue still exists.

If I run on android:

    final results = await FilePicker.getMultiFilePath(fileExtension: 'pdf', type: FileType.CUSTOM);

and I select several files, I have the log:

I/flutter ( 5209): [FilePicker] Unsupported operation. Method not found. The exception thrown was: NoSuchMethodError: The method 'split' was called on null.

and the results variable is null. Note that if I select only one file, everything works correctly.

If you need more information don't hesitate.

@miguelpruivo
Copy link
Owner

@Peltoche can you tell me which Android version are you running on? Does that happen in the example app as well?

Thank you.

@miguelpruivo miguelpruivo reopened this Jun 2, 2019
@Peltoche
Copy link

Peltoche commented Jun 2, 2019

Yep, I can reproduce with the example.

For the emulator:

1 available emulator:

Pixel_2_API_28 • pixel_2 • Google • Pixel 2 API 28

For the flutter version:

Flutter 1.6.6 • channel dev • git@github.com:flutter/flutter.git
Framework • revision e1a784ae3f (4 days ago) • 2019-05-28 21:53:03 -0700
Engine • revision 8dc3a4cde2
Tools • Dart 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)

@miguelpruivo
Copy link
Owner

@Peltoche and you're selecting multiple pdf files, right? I'll check this ASAP and keep you updated.

Thank you.

@miguelpruivo miguelpruivo added this to the 1.4.0 milestone Jun 2, 2019
@GauravPatni
Copy link

hi @miguelpruivo ,

I am facing the same issue of File Path = null .

Please refer attached screenshots for more details
step 1

step 2

step 3

step 4

after selecting DL.csv file I am getting the following log

I/flutter ( 7855): /data/data/com.example.test_dl/app_flutter
I/FilePicker( 7855): Checking permission: android.permission.WRITE_EXTERNAL_STORAGE
I/Timeline( 7855): Timeline: Activity_launch_request time:1989190
I/flutter ( 7855): My File Path = null
I/Timeline( 7855): Timeline: Activity_idle id: android.os.BinderProxy@4220dbe8 time:2084493

Note that to check compatibility with old android devices, I have used Android 4.4.4 device

device info

Also, note that this happens only when I selected a file by using "File Manager". But when I try to get Image file path using "Gallery" then I get a valid path as follows

I/flutter ( 7855): /data/data/com.example.test_dl/app_flutter
I/FilePicker( 7855): Checking permission: android.permission.WRITE_EXTERNAL_STORAGE
I/Timeline( 7855): Timeline: Activity_launch_request time:2213059
I/FilePicker( 7855): [SingleFilePick] File URI:content://com.miui.gallery.open/raw/%2Fstorage%2Femulated%2F0%2FDCIM%2FCamera%2FIMG_20190522_142114.jpg
E/FilePickerUtils( 7855): Getting for API 19 or abovecontent://com.miui.gallery.open/raw/%2Fstorage%2Femulated%2F0%2FDCIM%2FCamera%2FIMG_20190522_142114.jpg
E/FilePickerUtils( 7855): NO DOCUMENT URI - CONTENT
I/FilePicker( 7855): Absolute file path:/storage/emulated/0/DCIM/Camera/IMG_20190522_142114.jpg
I/flutter ( 7855): My File Path = /storage/emulated/0/DCIM/Camera/IMG_20190522_142114.jpg
I/Timeline( 7855): Timeline: Activity_idle id: android.os.BinderProxy@4220dbe8 time:221642

Please help how to resolve this issue of File Path = null . when using "File manager"

Thanks ,
Gaurav

@miguelpruivo
Copy link
Owner

miguelpruivo commented Jun 15, 2019

@GauravPatni thank you for your feedback. Is this a custom file manager (aka 3rd party) installed on the device? Because if it is, there are known issues where 3rd party file managers, handle the path differently and doesn’t returns it as it should, and thus, I return null instead to prevent wrong handling of the file.

@Peltoche I've tried it right now with the exact same steps (same emulator, version and picking type) of you, and it works flawlessly. Mind I ask you if you are using a custom file picker? Or the default native one?

@Peltoche
Copy link

@Peltoche I've tried it right now with the exact same steps (same emulator, version and picking type) of you, and it works flawlessly. Mind I ask you if you are using a custom file picker? Or the default native one?

Nop, I don't think so.

@miguelpruivo
Copy link
Owner

@Peltoche, I’m not able to reproduce your issue. Can you screen record it so I can get a deeper understanding of what may be causing it?

Thank you.

@Peltoche
Copy link

@Peltoche, I’m not able to reproduce your issue. Can you screen record it so I can get a deeper understanding of what may be causing it?

I have stopped my project and I don't think I will have the time soon, sorry. Maybe one week-end I will put a video or a PR.

@robinmaass
Copy link

Hi
Same issue here.
Single file picker works fine. If I select multiple files, I get an error.
Using native file manager.
Target sdk version 28 (I assume that's the problem as with >= 24 you should use FileProvider.
Your example app has the same problem.
Tested with Galaxy Tab S4 and Note 8

Maybe have a look here:
https://stackoverflow.com/questions/53240556/opening-file-via-intent-using-uri-on-api-24
and
https://stackoverflow.com/questions/53995161/requires-android-permission-access-all-downloads-or-granturipermission

Here's the error message:
D/ViewRootImpl@9142136MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@9142136MainActivity: ViewPostIme pointer 1
D/ViewRootImpl@9142136MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@9142136MainActivity: ViewPostIme pointer 1
D/ViewRootImpl@9142136MainActivity: ViewPostIme pointer 0
D/ViewRootImpl@9142136MainActivity: ViewPostIme pointer 1
D/ViewRootImpl@9142136MainActivity: MSG_WINDOW_FOCUS_CHANGED 0 1
D/InputMethodManager(31270): prepareNavigationBarInfo() DecorView@6b103f[MainActivity]
D/InputMethodManager(31270): getNavigationBarColor() -855310
D/InputTransport(31270): Input channel destroyed: fd=90
D/SurfaceView(31270): onWindowVisibilityChanged(8) false io.flutter.view.FlutterView{2014b0d VFE...... ........ 0,0-2560,1504} of ViewRootImpl@9142136[MainActivity]
D/SurfaceView(31270): show() Surface(name=SurfaceView - com.mr.flutter.plugin.filepickerexample/com.mr.flutter.plugin.filepickerexample.MainActivity@2014b0d@2[31270])/@0x951b872 io.flutter.view.FlutterView{2014b0d VFE...... ........ 0,0-2560,1504}
D/SurfaceView(31270): surfaceDestroyed callback.size 1 #2 io.flutter.view.FlutterView{2014b0d VFE...... ........ 0,0-2560,1504}
D/SurfaceView(31270): destroy() Surface(name=SurfaceView - com.mr.flutter.plugin.filepickerexample/com.mr.flutter.plugin.filepickerexample.MainActivity@2014b0d@2[31270])/@0x951b872 io.flutter.view.FlutterView{2014b0d VFE...... ........ 0,0-2560,1504}
D/OpenGLRenderer(31270): eglDestroySurface = 0x7b5bd58900, 0x7b7abc9000
D/ViewRootImpl@9142136MainActivity: Relayout returned: old=[0,0][2560,1600] new=[0,0][2560,1600] result=0x5 surface={false 0} changed=true
D/ViewRootImpl@9142136MainActivity: stopped(true) old=false
D/SurfaceView(31270): windowStopped(true) false io.flutter.view.FlutterView{2014b0d VFE...... ........ 0,0-2560,1504} of ViewRootImpl@9142136[MainActivity]
D/SurfaceView(31270): onWindowVisibilityChanged(4) false io.flutter.view.FlutterView{2014b0d VFE...... ........ 0,0-2560,1504} of ViewRootImpl@9142136[MainActivity]
D/ViewRootImpl@9142136MainActivity: Relayout returned: old=[0,0][2560,1600] new=[0,0][2560,1600] result=0x1 surface={false 0} changed=false
E/FilePickerUtils(31270): Getting for API 19 or abovecontent://com.android.providers.media.documents/document/image%3A6983
E/FilePickerUtils(31270): Document URI
E/FilePickerUtils(31270): Media Document URI
I/FilePickerUtils(31270): Image Media Document URI
D/AndroidRuntime(31270): Shutting down VM
E/AndroidRuntime(31270): FATAL EXCEPTION: main
E/AndroidRuntime(31270): Process: com.mr.flutter.plugin.filepickerexample, PID: 31270
E/AndroidRuntime(31270): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=29062, result=-1, data=Intent { flg=0x1 clip={image/* U:content://com.android.providers.media.documents/document/image%3A6983 ...} }} to activity {com.mr.flutter.plugin.filepickerexample/com.mr.flutter.plugin.filepickerexample.MainActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=31270, uid=10264 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
E/AndroidRuntime(31270): at android.app.ActivityThread.deliverResults(ActivityThread.java:4616)
E/AndroidRuntime(31270): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4658)
E/AndroidRuntime(31270): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
E/AndroidRuntime(31270): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(31270): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(31270): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1959)
E/AndroidRuntime(31270): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(31270): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(31270): at android.app.ActivityThread.main(ActivityThread.java:7075)
E/AndroidRuntime(31270): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(31270): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(31270): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
E/AndroidRuntime(31270): Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=31270, uid=10264 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
E/AndroidRuntime(31270): at android.os.Parcel.createException(Parcel.java:1966)
E/AndroidRuntime(31270): at android.os.Parcel.readException(Parcel.java:1934)
E/AndroidRuntime(31270): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
E/AndroidRuntime(31270): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
E/AndroidRuntime(31270): at android.content.ContentProviderProxy.query(ContentProviderNative.java:418)
E/AndroidRuntime(31270): at android.content.ContentResolver.query(ContentResolver.java:809)
E/AndroidRuntime(31270): at android.content.ContentResolver.query(ContentResolver.java:759)
E/AndroidRuntime(31270): at android.content.ContentResolver.query(ContentResolver.java:717)
E/AndroidRuntime(31270): at com.mr.flutter.plugin.filepicker.FileUtils.getDataColumn(FileUtils.java:131)
E/AndroidRuntime(31270): at com.mr.flutter.plugin.filepicker.FileUtils.getForApi19(FileUtils.java:108)
E/AndroidRuntime(31270): at com.mr.flutter.plugin.filepicker.FileUtils.getPath(FileUtils.java:33)
E/AndroidRuntime(31270): at com.mr.flutter.plugin.filepicker.FilePickerPlugin$1.onActivityResult(FilePickerPlugin.java:65)
E/AndroidRuntime(31270): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:204)
E/AndroidRuntime(31270): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:132)
E/AndroidRuntime(31270): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:142)
E/AndroidRuntime(31270): at android.app.Activity.dispatchActivityResult(Activity.java:7772)
E/AndroidRuntime(31270): at android.app.ActivityThread.deliverResults(ActivityThread.java:4609)
E/AndroidRuntime(31270): ... 11 more
I/Process (31270): Sending signal. PID: 31270 SIG: 9
Lost connection to device.
Exited (sigterm)

@bunnywrote
Copy link

Video: file_picker_issue.zip

It seems, I have the same problem on my device

OnePlus 3T, Android 8.0

As you can see in the video (attached as zip), if I select just one file in file_picker dialog it works, but where I try to add 3 files (in this case) with multiple select no one will be added and I see this error in the console:

E/FilePickerUtils(14128): Getting for API 19 or abovecontent://com.android.providers.downloads.documents/document/189
E/FilePickerUtils(14128): Document URI
E/FilePickerUtils(14128): Downloads External Document URI
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/189
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/189 from pid=14128, uid=10330 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()
I/FilePicker(14128): [MultiFilePick] File #0 - URI: /document/189
E/FilePickerUtils(14128): Getting for API 19 or abovecontent://com.android.providers.downloads.documents/document/334
E/FilePickerUtils(14128): Document URI
E/FilePickerUtils(14128): Downloads External Document URI
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/334
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/334 from pid=14128, uid=10330 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()
I/FilePicker(14128): [MultiFilePick] File #1 - URI: /document/334
E/FilePickerUtils(14128): Getting for API 19 or abovecontent://com.android.providers.downloads.documents/document/335
E/FilePickerUtils(14128): Document URI
E/FilePickerUtils(14128): Downloads External Document URI
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/335
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/335 from pid=14128, uid=10330 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()
I/FilePicker(14128): [MultiFilePick] File #2 - URI: /document/335
I/OpenGLRenderer(14128): Initialized EGL, version 1.4
D/OpenGLRenderer(14128): Swap behavior 2
I/flutter (14128): [FilePicker] Unsupported operation. Method not found. The exception thrown was: NoSuchMethodError: The method 'split' was called on null.
I/flutter (14128): Receiver: null
I/flutter (14128): Tried calling: split("/")
I/flutter (14128): Receiver: null
I/flutter (14128): Tried calling: split("/")
I/flutter (14128): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
I/flutter (14128): #1 FilePicker._getPath. (package:file_picker/file_picker.dart:53:77)
I/flutter (14128): #2 MapBase._fillMapWithMappedIterable (dart:collection/maps.dart:63:14)
I/flutter (14128): #3 new LinkedHashMap.fromIterable (dart:collection/linked_hash_map.dart:112:13)
I/flutter (14128): #4 FilePicker._getPath (package:file_picker/file_picker.dart:53:9)

@miguelpruivo
Copy link
Owner

miguelpruivo commented Jun 19, 2019

@robinmaass that's odd because I've been running it on api 28 without a problem. Do you have your app with Android X support? Because that's a requirement in order for it to work.

@bunnywrote I've removed the writing/reading permissions in 1.3.6, can you try with file_picker: 1.3.5 and let me know if it's working for you?

Thank you.

@bunnywrote
Copy link

@bunnywrote I've removed the writing/reading permissions in 1.3.6, can you try with file_picker: 1.3.5 and let me know if it's working for you?

I downgraded file_picker package to 1.3.5, but have the same error, BUT if try to select mutiple files not in Downloads folder (Camera in my case) it works

@miguelpruivo
Copy link
Owner

@bunnywrote and with 1.3.6?

@bunnywrote
Copy link

@bunnywrote and with 1.3.6?

It works with 1.3.6 as well. Also in my case it seems to be an issue just for multiselect in Downloads folder.

@miguelpruivo
Copy link
Owner

@bunnywrote @robinmaass can you please check the fix already on beta? Change your file_picker dependency to the following:

  file_picker:
    git:
      url: https://github.com/miguelpruivo/plugins_flutter_file_picker.git
      ref: beta

Don't forget to flutter clean first and then let me know if it's working for you. 👍

Thank you.

@miguelpruivo miguelpruivo added triage Further information is requested bug Something isn't working and removed triage Further information is requested labels Jun 23, 2019
@miguelpruivo miguelpruivo added wip and removed on hold labels Jun 23, 2019
@robinmaass
Copy link

Hey Miguel

Happy to tell you that beta works now on android with multiselect (also from download folder and also with different file types). Tested on Tab s4. Great work. Thank you!

@miguelpruivo
Copy link
Owner

Fixed in 1.3.7.

Feel free to reopen it if you still find any issue related to this.
Thank you all.

@prasant10050
Copy link
Author

I m facing this issue again

java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/335
E/FilePickerUtils(14128): Something went wrong while retrieving document path: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/335 from pid=14128, uid=10330 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()

@ziakhan110
Copy link

this issue is happening of Infinix Note 5 android 10, how to solve this, Help Please

@xzghx
Copy link

xzghx commented Feb 20, 2021

Hi
I get null for file.path in web. It works fine in android 9 .
this is code I used:

 FilePickerResult result = await FilePicker.platform.pickFiles(
      type: FileType.custom,
      allowedExtensions: ['jpg', 'jpeg'],
    );
    if(result != null) {
      PlatformFile file = result.files.single;
      _blogImage = File(file.path);
      notifyListeners();

    } else {
      // User canceled the picker
    }

this is the log :

`Error: Invalid argument(s) (path): Must not be null
    at Object.throw_ [as throw] (http://localhost:56733/dart_sdk.js:4339:11)
    at Function.checkNotNull (http://localhost:56733/dart_sdk.js:123079:39)
    at Function._checkNotNull (http://localhost:56733/dart_sdk.js:52009:26)
    at new io._File.new (http://localhost:56733/dart_sdk.js:52015:30)
    at Function.new (http://localhost:56733/dart_sdk.js:51120:16)
    at blog_provider.BlogProvider.new.pickImageForBlog (http://localhost:56733/packages/my_personal_site/data/Provider/blog_provider.dart.lib.js:101:41)
    at pickImageForBlog.next (<anonymous>)
    at http://localhost:56733/dart_sdk.js:37679:33
    at _RootZone.runUnary (http://localhost:56733/dart_sdk.js:37533:58)
    at _FutureListener.thenAwait.handleValue (http://localhost:56733/dart_sdk.js:32507:29)
    at handleValueCallback (http://localhost:56733/dart_sdk.js:33054:49)
    at Function._propagateToListeners (http://localhost:56733/dart_sdk.js:33092:17)
    at _Future.new.[_completeWithValue] (http://localhost:56733/dart_sdk.js:32935:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:56733/dart_sdk.js:32957:35)
    at Object._microtaskLoop (http://localhost:56733/dart_sdk.js:37794:13)
    at _startMicrotaskLoop (http://localhost:56733/dart_sdk.js:37800:13)
    at http://localhost:56733/dart_sdk.js:33309:9`

other fields are ok and have value but path is null

   print(file.name); //ok
   print(file.bytes); //ok
   print(file.size); //ok
   print(file.extension); //ok
   print(file.path); //Null in web

@miguelpruivo
Copy link
Owner

@xzghx on web you need to use bytes not path as it isn’t supported.

@chirag-dt
Copy link

@miguelpruivo we have also try bytes to upload image from web still same error

@miguelpruivo
Copy link
Owner

What do you mean by the same error? The error above is referring to path, not bytes. If you use bytes, you can't get an a NPE on web.

@chirag-dt
Copy link

yes, we are getting path null

@miguelpruivo
Copy link
Owner

@arjun-ckpatel like I said, you can't use paths on web. You need to use the bytes property instead.

@hardikvij195
Copy link

how are we supposed to upload file with file.bytes ?

@miguelpruivo
Copy link
Owner

Using a multipart file. There a few examples around here.

@erperejildo
Copy link

any solution yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Further information is requested
Projects
None yet
Development

No branches or pull requests