0

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:

  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!

2

1 Answer 1

0

First, it is not true that all files are accessible on Windows-10 and browser. This is for security On Windows, you need something like IIS or Apache running. I expect its the same on Android.

1
  • Thank you for your answer! In Windows 10, if you put all the HTML and GIF files in the same local folder, and refer to them using local URLs like ...href="a1.html"..., ...src="smily.gif"... etc., then Chrome successfully follows the links and displays correctly the intended documents and images. I am trying to transfer the very same HTML and GIF files to a local folder on my Android 10 tablet, but so far in vain (Chrome does not find the other HTML and GIF files that are located in the same folder). If the security issues are solved in Windows, why can't they be solved in Android, too? Thanks
    – user7733
    Feb 23 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .