apache / apache/cordova-plugin-file-transfer

open failed: EACCES (Permission denied)

Open
#332 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
606
Forks
874
PR merge metrics
No merged PRs in 30d

Description

I try to transfer document files (pdf,docx,...), and it's ok with API < 29. But now I always get 'open failed: EACCES (Permission denied)' when trying it on API >= 29

Here is my code:

window.resolveLocalFileSystemURL(fpath, (entry) => {
let options = new FileUploadOptions();
options.httpMethod = 'POST';
options.fileKey = 'file';
options.fileName = entry.name;
options.mimeType = entry.type;
options.params = {
id: 1
};

let fileTransfer = new FileTransfer();
fileTransfer.upload(entry.nativeURL, 'http://localhost/upload.php', (suc) => {
console.log(suc)
}, error => console.log(error), options);

}, error => console.log(error));

Contributor guide

Open the contributing guide

Research direction

Start with the provided resolveLocalFileSystemURL and FileTransfer.upload calls, reproducing the EACCES failure on Android API 29 or later. Inspect the plugin's Android implementation and determine the relevant file-access path; done means document uploads work on API 29+ without breaking the API <29 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
mobile
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.