ionic-team / ionic-team/capacitor-filesystem
feat: Support binary data in FileSystem API
- Dominant language
- TypeScript
- Stars
- 6
- Forks
- 15
- Avg merge
- 14m
- Merged PRs (30d)
- 1
Description
## Feature Request
### Plugin
FileSystem
### Description
The FileSystem plugin should support binary data when using `appendFile`, `readFile`, and `writeFile`. An `encoding` key could be provided when working with utf8 encoded data.
To represent binary data in JS, Blobs (part of the [File API spec](https://w3c.github.io/FileAPI/)) should be used because they best represent file contents: immutable, potentially (but not necessarily) encoded, potentially (but not necessarily) with an associated mime type. Blobs can be converted to ArrayBuffers or streams for alternative use cases.
### Platform(s)
- Android
- iOS
- Web (IndexedDB supports Blobs)
### Additional Context
- Depends on https://github.com/ionic-team/capacitor/issues/984
- @diachedelic created a plugin which uses a separate HTTP server for serving binary data: https://github.com/diachedelic/capacitor-blob-writer
Contributor guide
Assessment
This issue has not been assessed yet.