I’m trying to save my file into Downloads folder but in android path_provider
package does not support getDownloadsDirectory
so I decided to save manually in /storage/emulated/0/Download
but it shows me this error message:
Unhandled Exception: FileSystemException: Cannot copy file to ‘storage/emulated/0/Download/filename’, path = ‘/data/user/0/com.xx.x/files/filename.pdf’ (OS Error: Operation not permitted, errno = 1)
my permission for storage is already granted using Permission.storage.request()
and I’ve also added
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
but still doesn’t work. Anyone willing to help?
3
Answers
It turns out to be a naming convention matter where they do not allow date time as name I think " : " for the time is the cause. Therefore I've changed the naming duplicate files as (1) (2) and it's working now.
yes the same,
I Cannot rename or copy
(OS Error: Operation not permitted, errno = 1)
on Android 11 and on 13
it’s well on Android 8
it seems that for rename/copy, the OS refused character like : in the name.
It was my issue.
It’s ok on Android 8, but not 10 or 13.
regards