I can access the APP directory to save/create files. However anything outside the APP dir is inaccessible.
For UWP I keep getting:
Access to the path 'C:\Users[user]\ Documents ' is denied.
Access to the path 'C:\Users[user]\ Pictures ' is denied.
I am using:
directory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
directory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
Manifest:
<uap:Capability Name="picturesLibrary" /> <uap:Capability Name="documentsLibrary" /> <uap:Capability Name="musicLibrary" /> <uap:Capability Name="videosLibrary" /> <uap:Capability Name="removableStorage" />
Microsoft documentation makes it seem like this will never be accessible, but I really have to be reading that wrong.
Any assistance is appreciated!!!
Ended up looping back on this:
https://github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows
Just makes life easier. Not a custom selector (which is what I was going for) but it works! No permissions issues!!!
Answers
The way you access the folder in uwp is not correct.
You need to use the Dependency Service to achieve this. The implementation varies between Android, iOS and Windows platforms, where the methods for the different platforms do similar things but in different ways.
For example:
On Android:
On iOS:
On WinRT:
On UWP:
Actually I had gotten the correct DIR location. The problem is that I can't access the folder.
To confirm it was correct I put it into a variable and went into debug, copied the DIR location (replaced the double "\", [Win key]+"R" and paste....DIR location is good. Re-running the app, I manually paste the DIR location in and same access problem.
So DIR location is good.
Access/Permissions is the problem.
Ended up looping back on this:
https://github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows
Just makes life easier. Not a custom selector (which is what I was going for) but it works! No permissions issues!!!