Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot share raw file on android. #12

Open
tommaso1 opened this issue Nov 14, 2018 · 2 comments
Open

Cannot share raw file on android. #12

tommaso1 opened this issue Nov 14, 2018 · 2 comments

Comments

@tommaso1
Copy link

Gmail says it cannot add the file as attachment.
await Share.file(title: 'dump.dat', path: path, text: 'Dump').share();
it says no error. But path is correct and i can read file from within the app at that given path

@mraabs
Copy link

mraabs commented Nov 14, 2018

I have a similar problem. I used the following code to share an image. However, I cannot share the image. Different apps give different reasons. Messages: Unable to load the file, Bluetooth: Unknow file format. Gmail: Cannot attach an empty file. BTW, the app already has the read and write permission.

Future<String> get _localPath async {
    final dir = await getExternalStorageDirectory();
    return dir.path;
  }
...
filePath = await _localPath;
...
await Share.image(
            path: '$filePath/s.jpg',
            title: "Spark It!",
            text: "Spark it! Find us in playstore",
            mimeType: ShareType.TYPE_IMAGE)
        .share(sharePositionOrigin: cardRect);

@mraabs
Copy link

mraabs commented Nov 22, 2018

after replacing the path address with 'file://$filePath/s.jpg' my problem got resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants