Share via

zipFile.ExtractToDirectory() error

Maddox 1 Reputation point
2022-03-26T13:34:16.353+00:00

I can't unzip a file in the destination path. Every time I get this error message: System.UnauthorizedAccessException: 'Access to the path "/ storage / emulated / 0 / Download / Matrix 08_06.enc' is denied".
In manifest I declared MANAGE_EXTERNAL_STORAGE and gave the file access permission to the app.
Anyone have an idea on how to fix?

Developer technologies | .NET | Xamarin
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2022-03-28T02:15:42.043+00:00

    Hello,​

    If you add MANAGE_EXTERNAL_STORAGE in your AndroidManifest.xml, you need to request this permission as well, Use the ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION intent action to direct users to a system settings page where they can enable the following option for your app: Allow access to manage all files.

    please refer to following thread.
    https://developer.android.com/training/data-storage/manage-all-files#all-files-access

    Please note: If you request MANAGE_EXTERNAL_STORAGE permission. Your application should be following permitted list that uses of the All files access permission. Otherwise, your application will be rejected from Google Play.

    • File management
    • Backup and restore apps
    • Anti-virus apps
    • Document management apps
    • Search (On Device)
    • Disk/Folder Encryption and Locking
    • Device Migration/Phone transfer

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.