ionic-team / ionic-team/capacitor-file-transfer

Downloading files on web to the filesystem saves it as base64 instead of a native blob

Open
#71 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11
Forks
10
PR merge metrics
No merged PRs in 30d

Description

## Bug Report

### Capacitor Version

```
@capacitor/cli: 7.4.0
@capacitor/android: 7.4.0
@capacitor/ios: 7.4.0
@capacitor/core: 7.4.0
@capacitor/file-transfer: 1.0.12
@capacitor/filesystem: 7.1.8
```

### Platform(s)

Web

### Current Behavior

We switched to this plugin to avoid the overhead of converting binary files to base64. This works for android and ios but downloading a file on the web using downloadFile downloads it as a blob but then converts it to base64 when trying to write it to the indexed db. The indexed db supports blob natively so this only increases the file size and each time we want to read the file we need to convert it back from base64 which is bad for big files.

### Expected Behavior

Just save the received blob directly to the indexed db.

### Code Reproduction

### Other Technical Details

see https://github.com/ionic-team/capacitor-file-transfer/blob/main/packages/capacitor-plugin/src/web.ts#L465

### Additional Context

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.