Search code examples
angularcordovaionic-frameworkcapacitorionic5

Problem capacitor with Capacitor convertFileSrc


Hi I use convertFileSrc from capacitor to get the size of the blob in order to upload videos on my application. It works fine for iOs but not on android. The blob size is always 0 because the file path seems to be wrong. I don't know how to solve this problem if someone has already encountered this problem please.

const test = Capacitor.convertFileSrc(f.fullPath);

Url :

http://localhost/_capacitor_file_/storage/emulated/0/Download/video.mp4 error 404

Thanks


Solution

  • Add android:requestLegacyExternalStorage="true" to the application tag in Android Manifest.xml solved this problem for me.