I am using a tablet (Lenovo M10 FHD Plus) which works under Android 10.
According to Local files revisited: Opening local HTML files (file:///path/to/file) in Chrome on Android 10.x, in order to use local URLs in HTML, I put my documents in the folder:
Files > Internal Storage > Android > data > com.android.chrome > files > Download
Inside my "index.html" file I use:
...href="a1.html"...
...src="smily.gif"...
The HTML files "index.html" and "a1.html" as well as the image "smily.gif" are located in my tablet inside the above-mentioned folder.
When I click on the file "index.html" and select Chrome, the file is correctly opened by Chrome... but the "smily.gif" image is not displayed (I get instead the alt="This is a smily" text). Furthermore, when I click there on the link (local URL) to open the document "a1.html" Chrome does NOT find it, and displays instead an empty page with the following error message:
Your file couldn't be accessed
It may have been moved, edited, or deleted.
ERR_FILE_NOT_FOUND
Needless to say, the above HTML samples work perfectly on my Windows 10 computer (including local links and images)!
My questions are:
- Where should I put my files "index.html", "a1.html" and "smily.gif" (if the above-mentioned folder is wrong)?
- If href="a1.html" and src="smily.gif" does not work in Android, how should I refer to local files in href= and src=?
- Can the instruction: base href="___" help us here, in case the answer to point (2) requires long file paths?
Thanks a lot for your kind help!