- Home /
Unauthorized Access Exception when trying to write to internal storage.
I'm trying to save a screen capture from an application I'm building.
ScreenCapture works great but it saves to persistent path and I want to put the screenshots in the camera folder. But trying to save the files there, moving them there or even just creating a new folder in internal storage returns the same result: "UnauthorizedAccessException: Access to the path "/sdcard/DCIM" is denied" (replace directory for wherever I'm trying to access).
My player settings are set to write permission internal but it doesn't seem to help.
Answer by RLin · Aug 06, 2018 at 03:12 PM
This may be a bit confusing, but in the player settings you have to set the write permission to external and not internal. This is because internal write permission means the app can only write to its own folder, while external write permission allows it to write to the sdcard.
If you set the write permission to external, your application will ask for permission to access photos and other media on startup, and you must click allow for writing to the sdcard to work.
You may have to go to your device’s settings app and turn on the permission from there.
Your answer
Follow this Question
Related Questions
[ANDROID]How to load images from a certain folder after a screenshot? 1 Answer
Capturing Screenshots on Android 1 Answer
Unity Android Streaming Assets Save/Recall w/ WWW class? 0 Answers
Take a Screenshot and Automatically have it Emailed to My Email (Android/iPhone) 0 Answers
EncodeToPNG problem on Android? 1 Answer