ionic-team / ionic-team/capacitor-filesystem

feat: Support binary data in FileSystem API

Open
#27 5 comments 11 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.