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 115 forks source link

Temporary file #75

Open ozzy1873 opened 4 years ago

ozzy1873 commented 4 years ago

Is there a way to delete the temporary file that gets created when downloading an image? Maybe this only occurs on the emulator. I don't see the temp file on a real phone (pixel 3).

Daryl149 commented 4 years ago

When using the example code, and implementing behind a button, I also get the temp files and have to delete manually. This happens on a real phone (Samsung Galaxy A10), connected to Android Studio.


    Future<void> resultDownloader(imageDownloadUrl) async {
      try {
        // Saved with this method.
        var imageId = await ImageDownloader.downloadImage(imageDownloadUrl);
        if (imageId == null) {
          return;
        }

        // Below is a method of obtaining saved image information.
        var fileName = await ImageDownloader.findName(imageId);
        var path = await ImageDownloader.findPath(imageId);
        var size = await ImageDownloader.findByteSize(imageId);
        var mimeType = await ImageDownloader.findMimeType(imageId);
      } on Exception catch (error) {
        print(error);
      }
    }

...

onPressed: () async {
                        await resultDownloader("https://raw.githubusercontent.com/wiki/ko2ic/image_downloader/images/flutter.png");
                      },
puntodamar commented 3 years ago

sorry for bumping this thread, how do i check the temporary file?