flutter_cache_manager icon indicating copy to clipboard operation
flutter_cache_manager copied to clipboard

error: FileSystemException: Cannot create file, path = '/data/user/0/com.example.myApp/cache/' (OS Error: Is a directory, errno = 21)

Open wyklif opened this issue 6 years ago • 0 comments

Hi, thanks for the wonderful plugin i am using the cache manager andtrying 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 i am using the plugin esys_flutter_share

wyklif avatar Aug 18 '19 12:08 wyklif