apache / apache/cordova-plugin-inappbrowser

Access Denied when open file in system storage

Open
#800 11 comments 4 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

# Bug Report
in my application. I use the InAppBrowser plugin to display files loaded from an API on the device memory.
But when displaying (Photo) file from device memory, the error is displayed as follows:

> `Webpage not available

The webpage at file:///storage/emulated/0/Android/data/com.kbd.bc/test.jpg could not be loaded because:
net::ERR_ACCESS_DENIED
`

I checked that the file "test.jpg" in the device memory still exists and can be opened in another photo viewer. Also I have applied for android permision permissions:
`

`

In addition I also go to the android Apps settings to allow the Storage permission to this App but also cannot display the image.
But when I run the application on Simulator and LDPlayer4 Simulator, the image is displayed well and there is no error.

Please help me out with what errors are and what can be done to fix them?

### Version information
What are relevant versions you are using?
InAppBrowser plugin: 4.0.0
Cordova: 9.0.0
Ionic: 1.7.16
NodeJs: v6.11.5
Mobile Device OS: Android 8.0

## Checklist

- [x ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [x ] I included all the necessary information above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the InAppBrowser 4.0.0 file-loading case on a physical Android 8.0 device using the reported file:///storage/emulated/0/Android/data/... path and permissions. Compare the behavior with the simulator results and inspect the Android side of the InAppBrowser plugin. Done means the reported image loads without ERR_ACCESS_DENIED, or the limitation and required handling are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.