skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. 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

    Login or Signup to reply.
  3. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search