apache / cordova-plugin-file-transfer

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

EPERM (Operation not permitted) #350

Closed atmanegara closed 1 year ago

atmanegara commented 1 year ago

"target":"file:///storage/emulated/0/Cobaan/folder-document/filename.docx"

I created a folder with the name "Cobaan" manually on the internal cellphone, then created a sub folder with the name "folder-document", and when downloading files to the destination directory the error open failed: EPERM (Operation notallowed) but if the destination folder downloads to the download / document folder it successfully downloads the file.


cordova 11 android 11

breautek commented 1 year ago

/storage/emulated/0/Cobaan/folder-document/filename.docx is not a writable path because you're pointing to a custom external storage location. As of Scoped Storage enforced in Android API 30, applications no longer have permission to create or use custom directories in external storage.

Instead, use your apps internal storage directory (e.g.: cordova.file.dataDirectory ) or if the files are intended to be shared, use one of the predefined external storage directories (e.g. cordova.file.externalDataDirectory ). Note that the externalRootDirectory is also not a writable path.

Closing as not a bug.