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

Appending to a file #11

Open
diachedelic opened this issue May 8, 2020 · 7 comments
Open

Appending to a file #11

diachedelic opened this issue May 8, 2020 · 7 comments

Comments

@diachedelic
Copy link
Owner

It would be good to be able to append to a file - then we could write even bigger files!

@diachedelic
Copy link
Owner Author

See #22.

@AgustinBaffo
Copy link

Hi there. I'm working in an app that has to write large volumes of data which are received via streaming. Since I can't store all the data in memory, I can't use write_blob. I was wondering if I could use this library but I saw that it doesn't have an append method 😞

I wanted to know if you are thinking of implementing the append feature? Or if there is any workaround for my use case?

@AgustinBaffo
Copy link

I found capacitor-file-chunk package that looks promising and uses this lib as a base code.

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.

I'll give a try to it.

@diachedelic
Copy link
Owner Author

Wow, I did not know about that plugin. Amazing!

Have you tried using write_blob? My understanding is that browsers flush Blobs to disk when there is insufficient memory available, so in theory this plugin should work for huge files.

@AgustinBaffo
Copy link

That won't work for me since I don't have the entire file in memory. I need to write as the chunks arrive.
In case anyone has the same problem capacitor-file-chunk package did the trick! 🥳

@diachedelic
Copy link
Owner Author

You use case shows that this plugin should support appending.

@diachedelic
Copy link
Owner Author

I have no idea when that will be implemented, though. I'm glad the File Chunk plugin worked for you.

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

2 participants