moberwasserlechner / capacitor-filesharer

Capacitor plugin to download and share files for the Web, Android and iOS! Stop the war in Ukraine!
MIT License
82 stars 20 forks source link

Feat: Can you share a text, json or csv file? #35

Closed ClintonThurman closed 1 year ago

ClintonThurman commented 2 years ago

Describe the Feature

I'd like to be able to share a text, csv and/or json file, but that currently doesn't look possible.

Platform(s) Support Requested

Describe Preferred Solution

The ability to also share text, csv and/or json files.

Describe Alternatives

Since I'm already using your plugin to share images, I'd prefer to use it to share/export text files as well. I know there are ways to get this done with similar plugins, but I'd rather use yours.

Related Code

    FileSharer.share({
        filename: 'filename.txt',
        base64Data: 'file content',
        contentType: 'text',
    });

Additional Context

I'm currently using capacitor 2

ClintonThurman commented 2 years ago

Just a heads up, the "related code" above will execute, but it'll save the file with base64 encoding. Since I'd like to save a text file, I'd prefer plain text with perhaps utf-8 encoding.

moberwasserlechner commented 1 year ago

No text is not supported. Duplicates #23