0

I am using the CachedImage component of ffimageloading. I have a kind of gallery with a carousel view.

All the images are loaded through an internet URL, they are not local images. I would like to add the image sharing function. But I don't want to download the file again, I would like to know if there is a way to access the file that the CachedImage component already downloaded to be able to reuse it in the share function.

Barto
  • 337
  • 2
  • 11

2 Answers2

1

try using MD5Helper

var path = ImageService.Instance.Config.MD5Helper.MD5("https://yourfileUrlOrKey")'
Jason
  • 86,222
  • 15
  • 131
  • 146
0

Thanks Jason

I share with you how part of my code is:

   var key = ImageService.Instance.Config.MD5Helper.MD5("https://yourfileUrlOrKey");
   var imagePath = await ImageService.Instance.Config.DiskCache.GetFilePathAsync(key);
   var tempFile = Path.Combine(Path.GetTempPath(), "test.jpg");
   if (File.Exists(tempFile))
   {
       File.Delete(tempFile);
   }
   File.Copy(imagePath, tempFile);

   await Share.RequestAsync(new ShareFileRequest
   {
       Title = "Test",
       File = new ShareFile(tempFile)
   });

The temporary file I believe, since the cached file has no extension and the applications do not recognize the type.

Barto
  • 337
  • 2
  • 11