apache / cordova-plugin-file-transfer

Apache Cordova File Transfer Plugin
https://cordova.apache.org/
Apache License 2.0
595 stars 888 forks source link

open failed: EACCES (Permission denied) #332

Open wengki opened 2 years ago

wengki commented 2 years ago

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));

phusting commented 1 year ago

I was getting that EACCES issue too and I found this article about changing the root owner to you. It worked for me. https://www.dailytask.co/task/error-eacces-permission-denied-rename-usrlocallibnodemodulescdk8s-clinodemodulescliui-ahmed-zidan

phusting commented 1 year ago

Whoever marked my comment as spam is wrong. That suggestion on the URL works.

breautek commented 1 year ago

Whoever marked my comment as spam is wrong. That suggestion on the URL works.

The linked article is about installing NPM modules. This issue is about the cordova file transfer plugin not being able to store files on the user's device. Two completely separate issues that are not related whatsoever. I marked it as spam because it appeared to be bot-like behaviour.

reinaldoborin commented 1 year ago

Having same problem.

bemendozaa commented 1 year ago

mismo problema