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

feat: get base64 data from url #2

Open
maximilien0405 opened this issue Jun 12, 2024 · 4 comments
Open

feat: get base64 data from url #2

maximilien0405 opened this issue Jun 12, 2024 · 4 comments

Comments

@maximilien0405
Copy link

Is your feature request related to a problem? Please describe.
Yes it is, but not in this plugin. Currently the Capacitor FileSystem copy() function does not work on android, it crashes the application. I use it to copy the file and paste it in the cache folder so that i can get the file's base64 data (this is the only solution i found that works..)

Describe the solution you'd like
A function that would allow me to give it the video url, and then it gives me the base64 data as a response?

Describe alternatives you've considered
The only alternative that i have does not work on android.. so that why it would be a great thing to implement ! If it's not possible or not in the scope of the plugin i would understand :)

Additional context
/

@shiv19
Copy link
Collaborator

shiv19 commented Jun 13, 2024

Video files are generally large and it is not a good idea to pass them through the bridge in one go as base 64, you would need to read it in chunk.
I'm planning to work on a way to upload the file from the native side itself. But that will likely not be an OSS plugin (I will try my best to make it OSS)

@shiv19
Copy link
Collaborator

shiv19 commented Jun 14, 2024

@maximilien0405
You can use this plugin to read large files in chunks over the bridge, and then upload from the browser side.

https://github.com/qrclip/capacitor-file-chunk

@maximilien0405
Copy link
Author

@shiv19 Wow that looks quite complicated but also seems like a good solution to handle large files ! Thank I will look into it and try to implement it !

@shiv19
Copy link
Collaborator

shiv19 commented Jun 14, 2024

@maximilien0405 another option I'm looking at is this:

https://github.com/spoonconsulting/cordova-plugin-background-upload

Use it with
https://github.com/danielsogl/awesome-cordova-plugins/tree/master

https://npm.im/@awesome-cordova-plugins/background-upload

This way, you don't need to bring the file over the bridge to begin with. :)

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