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!

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
user7733
  • 1
  • 2

1 Answers1

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.

Rohit Gupta
  • 3,363
  • 4
  • 16
  • 34