I am using the "@ionic-native/chooser": "^5.25.0"
package in my Ionic Capacitor app to select and then upload files. I need the file content to be encoded in base64 string format, however strangely enough this is only happening for iOS and not Android?
I am using Ionic v5 and Capacitor 2.0.1.
This is the json response I get on Android after selecting a file:
{data: Uint8Array(0), mediaType: "application/pdf", name: "standard-tube-map.pdf", uri: "content://com.dropbox.android.FileCache/filecache/3a2ef683-16b6-4b01-bd4c-69a0a03e2da1", dataURI: "data:application/pdf;base64,"}
As you can see the value for the dataURI
field should include the base64 string at the end of the string, however it seems to be missing: "data:application/pdf;base64,"
.
Anyone having the same issue? How did you solve it?
Many thanks in advance!!