0

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?

Unknown
  • 99
  • 8

3 Answers3

1

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

  • hello, 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 – jf wastiaux Apr 10 '23 at 19:50
  • yes you're right sir they refused : in the name because i was using date and time to make a unique file name so I ended up changed it to (1) (2) – Unknown Apr 19 '23 at 02:36
0

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

0

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.

Unknown
  • 99
  • 8