0

I want to pick files from storage using flutter, but in all libraries the picked file writes to cache immediately and returns the cached URL (/data/data/package/cache...). Sometimes it's OK, but in case of multiple files and large sized files this is not acceptable. I have tried with image_picker,file_picker etc. Is there anything I am missing or any other libraries that can satisfy my requirement? This is happening while testing in android. I didn't test with iOS.

Grasshopper
  • 1,749
  • 1
  • 14
  • 30
Bibin KJ
  • 77
  • 8

2 Answers2

0

Use clearTemporaryFiles() method or pick files library below 2.0.0. From version 2.0.0 every file is cached on Android platform.

Kubus
  • 1
0

I have found this method to overcome this

import 'package:path_provider/path_provider.dart';
final directory = await getTemporaryDirectory();
directory.delete(recursive: true);
final result = await FilePicker.platform.pickFiles();
......

and your rest of the code