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

Support for larger files #61

Closed
crabbydavis opened this issue May 4, 2023 · 4 comments
Closed

Support for larger files #61

crabbydavis opened this issue May 4, 2023 · 4 comments

Comments

@crabbydavis
Copy link

First, thanks for the plugin! I'm using this to download and then write a sqlite DB to memory. My initial DB size is 320MB and the plugin isn't able to write a file that size (at least on iOS on an iPhone 12 mini). The largest file I've been able to write so far is 270MB. The plugin was able to write the 320MB file on my laptop on the iOS simulator.

The plugin tries to use the fallback mode, but that also fails. It ends up creating the file but doesn't write any data into it.

The error I get is for the 320MB file is, "WebKit encountered an internal error."

Thanks for taking a look at this!

Screenshot 2023-05-04 at 9 05 11 AM

@diachedelic
Copy link
Owner

Duplicate of #22. Do you have time to implement the append feature (#11), a prerequisite for what you're asking?

@Miguelmcanabal
Copy link

Any news on this? Im facing the same issue.

@crabbydavis
Copy link
Author

@Miguelmcanabal I ended up just using the @capacitor/filesystem plugin. There's an appendFile method so that you can write the file in chunks. If you fetch your file as an array buffer, you can loop through it, grab slices, and write those slices using appendFile. I don't have timings to provide, but it writes quickly.

@AgustinBaffo
Copy link

AgustinBaffo commented Oct 15, 2024

I was able to wrote huge files (>5GB) using capacitor-file-chunk package. They implemented the append feature on the top of this repo:

This plugin builds on the original concept and code of the Capacitor Blob Writer plugin by providing the ability to read and write files in chunks, offering improved performance compared to the Capacitor Filesystem plugin. It enables direct communication and exchange of binary data with a localhost web server, eliminating the need for base64 conversion.

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

4 participants