Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Error when trying to share from cache #34

Closed
wyklif opened this issue Aug 18, 2019 · 1 comment
Closed

Error when trying to share from cache #34

wyklif opened this issue Aug 18, 2019 · 1 comment

Comments

@wyklif
Copy link

wyklif commented Aug 18, 2019

Hi, thanks for the wonderful plugin i am using the cache manager and rather than download the image i am trying to share an image from cache manager like so

  try {
      final ByteData bytes = await rootBundle.load(path);
      await Share.file(
          fileName, fileName, bytes.buffer.asUint8List(), 'image/png',
          text: 'Shared from myApp');
    } catch (e) {
      print('error: $e');
    }

i am getting the path from cache manager like

 Future<String> findCachedImagePath(String imageUrl) async {
    var file = await DefaultCacheManager().getSingleFile(imageUrl);
    return file.path;
  }

and it returns to me this string
/data/user/0/com.example.myApp/cache/libCachedImageData/e6cb8eb0-c1a7-11e9-8d36-096d03933f81.jpeg

however on trying to share i get this error
error: FileSystemException: Cannot create file, path = '/data/user/0/com.example.myApp/cache/' (OS Error: Is a directory, errno = 21)

help would be appriciated, thanks

@wyklif
Copy link
Author

wyklif commented Aug 19, 2019

opted to share from url , Thanks for the wonderful plugin

@wyklif wyklif closed this as completed Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant