Get file path from system directory using Flutter web (chrome) to read file content Eg: CSV or Text file


Package tried:

Tried the example code implementation shared via GitHub. But the file path is returned as null for
web platform. Where same implementation in mobile platform return the path as expected.

Things aware of:

  1. Path_Provider – Not supported for web
  2. dart-io-library – Not supported for web
  3. Open issue in Flutter Repo

Goal is to read the file from the path and not to upload. Any workaround to achieve this will be helpful.

Flutter channel: beta


As mentioned in the file_picker FAQ:

Paths aren’t inaccessible from browsers since those provide fake paths. If you want to create a File instance to upload it somewhere, like FireStorage, you can do so with the bytes directly.

final result = await FilePicker.platform.pickFiles(type: FileType.any, allowMultiple: false);

if (result.files.first != null){
  var fileBytes = result.files.first.bytes;
  var fileName =;

Answered By – Spatz

Answer Checked By – Dawn Plyler (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *