Ionic Native Http File:// Protocol


#1

I am trying to get a local JSON file in my ionic application. First, I have to download the file form a remote server. Which I did here and store them in this format

this.file.externalDataDirectory + "assets/"+ (index + 1)  +".json";

I want to make a local request using the ionic native HTTP plugin, But I am getting an “Unexpected protocol: file” error.


#2

Why aren’t you using ordinary Angular HttpClient?


#3

I am facing CORS issues If I use to request from local files


#4

Are you using cordova-plugin-ionic-webview? If not, can you? It has a convertFileSrc method that may help you.


File Chooser URL issue