Download local file and get Unknown chrome error: -6

I tried to upload a local file from sdcard to WebView. But since Android 4.1 it no longer works, I always get the message: File not found in LogCat

Unknown chromium error: -6. 
+6
source share
1 answer

I understood the problem, and I just needed to add another slash. Example:

Now we need:

 loadURL("file:///.../file.file"); 

instead:

 loadURL("file://.../file.file"); 

Just add another slash and it works. Hope this will be useful for everyone with the same issue in Android 4.1.

+4
source

Source: https://habr.com/ru/post/924523/


All Articles