0

I have some HTML files in the SD card in my phone, which I want to open in Chrome. But, when I am entering the URL of those files in the Chrome's address bar with the file:/// prefix, Chrome says Access to the file was denied. But, I have checked that Chrome has access to the storage. See this screenshot:

Please help me out.
I have Android 7.0 Nougat and please ask if any more information is required.

8
  • Are you able to save pages to your sd card when using Chrome? Commented Jul 17, 2019 at 12:14
  • Yes, of course.
    – Puspam
    Commented Jul 17, 2019 at 12:17
  • Copy the file to the internal storage and check if Chrome can open it. Commented Jul 17, 2019 at 12:22
  • Yes, it can open from the internal storage.
    – Puspam
    Commented Jul 17, 2019 at 12:27
  • It seems that Chrome does not have the permission to read the external storage although you have enabled it. Commented Jul 17, 2019 at 12:34

2 Answers 2

2

Chrome can read file from the SD card folders it has access to. That folder, if you have set to download pages on the SD card, can be located by clicking Menu, then Downloads, then clicking on the gear. You have unrestricted access to that folder. But if you try to navigate to the parent folder, you will receive an Access to the file was denied message (if that folder is located on the SD card).

You can copy your files in that folder and read it from there. Or you can copy them to the internal storage and access the internal storage by typing file:///sdcard/ from Chrome's address bar. The internal storage is not restricted and you can navigate to any folder.

7
  • You are right, Chrome can read and write from the Android/data/com.android.chrome/files/download folder in the SD card, but is unable to access it's parent directories. Thanks.
    – Puspam
    Commented Jul 17, 2019 at 15:17
  • I have made a browser app of my own. In that app, everything is working fine, it is able to access the SD card. See this screenshot. I can still remember that I haven't used any special permissions in that app.
    – Puspam
    Commented Jul 17, 2019 at 15:29
  • @PuspamAdak I will have to check but if I remember correctly Firefox is also able to access the SD card in its entirety. Commented Jul 17, 2019 at 15:36
  • I know that using ADB, we can grant permissions to apps. So, is there any way to grant SD card reading permission to Chrome?
    – Puspam
    Commented Jul 18, 2019 at 10:59
  • @PuspamAdak I am not sure if it is going to work or not on a non rooted phone. But you can try (if you have not already done it) the following command: adb shell pm grant com.android.chrome android.permission.READ_EXTERNAL_STORAGE. I have a rooted phone and with some Xposed modules, Chrome has full access to the SD card. Commented Jul 18, 2019 at 12:08
0

Am not a devloper but according to my experience -

Actually after an update you can check in your Android Apps Manager Settings you will see Chrome is only allowed to read only MEDIA files not EXTERNAL files. To fix this those who have APK EDITORS in your PC, you can edit the MANIFEST file to change the permission (READ_EXTERNAL_STORAGE), otherwise please contact Google to inform this issueenter image description here

You must log in to answer this question.

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