HTML does not find local links and local images (Chrome on Android 10)
0
votes
1
answer
1328
views
I am using a tablet (Lenovo M10 FHD Plus) which works under Android 10.
According to https://android.stackexchange.com/questions/220400/local-files-revisited-opening-local-html-files-file-path-to-file-in-chrome , 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:
1) Where should I put my files "index.html", "a1.html" and "smily.gif" (if the above-mentioned folder is wrong)?
2) If href="a1.html" and src="smily.gif" does not work in Android, how should I refer to local files in href= and src=?
3) 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!
Asked by user7733
(1 rep)
Feb 22, 2024, 02:34 PM
Last activity: Feb 23, 2024, 01:30 PM
Last activity: Feb 23, 2024, 01:30 PM