ko2ic / image_downloader

Flutter plugin that downloads images and movies on the Internet and saves to Photo Library on iOS or specified directory on Android.
https://pub.dartlang.org/packages/image_downloader#-readme-tab-
MIT License
92 stars 116 forks source link

How to access file name of downloaded file? #4

Closed apurvh closed 5 years ago

apurvh commented 5 years ago

I want to open the file as soon as it is downloaded, for that path/filename is required. OpenFile.open(path);

Is it possible to get the filename/path?

ko2ic commented 5 years ago

@Apurv2017 Added function to get filename.

update 0.11.0.

Please refer to the sample below

  var imageId = await ImageDownloader.downloadImage("https://raw.githubusercontent.com/wiki/ko2ic/image_downloader/images/flutter.png");
  if (imageId == null) {
    return;
  }

  var fileName = await ImageDownloader.findName(imageId);
  var path = await ImageDownloader.findPath(imageId);