简体   繁体   中英

How to get actual file path with file_picker package in flutter

I wanted to delete a file from device storage after receiving the file path from file_picker. but the problem is file_picker returns a path of a temporary copy of the file from the application's directory. Is there a way to get the actual path of the file file_picker picks?

For image_picker

var pickedImage = await _picker.getImage(source: ImageSource.gallery, imageQuality: 25);
File image = File(pickedImage.path);

for file_picker

FilePickerResult res = await FilePicker.platform.pickFiles();
File image = File(res.files.first.path);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM