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

Downloading image from URL, Image downloads but downloads another file with the same name with no file type. #81

Open tiltmaster opened 4 years ago

tiltmaster commented 4 years ago

So, I have been successful in downloading an image from a URL and storing it in the device, The issue that I am facing is that it also downloads a file with the same name as the downloaded image, but without file type.

Example, downloading Image.jpg will also download a file named Image, and it is visible within the device.

saveImage(Message message) async {
    String url = message.photoURL;
    try {
      var imageId = await ImageDownloader.downloadImage(
        url,
        destination: AndroidDestinationType.custom(directory: 'dir'),
      );
      if (imageId == null) {
        return;
      }
      setState(() {
        SnackBar snackBar = SnackBar(
          content: Text('Image Saved!'),
        );
        _scaffoldKey.currentState.showSnackBar(snackBar);
        Timer(Duration(seconds: 2), () {});
      });
      if (imageId == null) {
        return;
      }
    } on PlatformException catch (error) {
      print(error);
    }
  }

pwO6f

mc10sw commented 4 years ago

i have same issue on specific phones (Galaxy A9 pro, but not Galaxy note8 and Galaxy A90)

gulnaz-zh commented 4 years ago

The same situation

tiltmaster commented 4 years ago

hm still no support on this one.

haytham-c01 commented 4 years ago

Same problem!

furkankurt commented 4 years ago

Same here.

bahador-r commented 3 years ago

same issues

emersonbf commented 3 years ago

I have the same problem. Does anyone have a solution?

emersonbf commented 3 years ago

Portanto, consegui baixar uma imagem de um URL e armazená-la no dispositivo. O problema que estou enfrentando é que ele também baixa um arquivo com o mesmo nome da imagem baixada, mas sem o tipo de arquivo.

Por exemplo, o download de Image.jpg também fará o download de um arquivo denominado Image, e é visível dentro do dispositivo.

saveImage(Message message) async {
    String url = message.photoURL;
    try {
      var imageId = await ImageDownloader.downloadImage(
        url,
        destination: AndroidDestinationType.custom(directory: 'dir'),
      );
      if (imageId == null) {
        return;
      }
      setState(() {
        SnackBar snackBar = SnackBar(
          content: Text('Image Saved!'),
        );
        _scaffoldKey.currentState.showSnackBar(snackBar);
        Timer(Duration(seconds: 2), () {});
      });
      if (imageId == null) {
        return;
      }
    } on PlatformException catch (error) {
      print(error);
    }
  }

pwO6f

solution?

crsmillan commented 3 years ago

same problem!!

JihyeJung-Work commented 2 years ago

me too..

euzentinh commented 2 years ago

Same with pixel 3a / android 12 Image is in both Pictures and Download

var imageId = await ImageDownloader.downloadImage(
        imgUrl,
        destination: AndroidDestinationType.directoryPictures
);
dexter369 commented 2 years ago

update?