Can't write txt file in Flash Drive Xamarin.Android / Xamarin.UWP

Hello guys,

I have some troubles.
It's about this subject => https://forums.xamarin.com/discussion/151387/system-unauthorizedaccessexception-access-to-the-path

I don't know if I am in the right section.

I can't write a file in the root path (from the USB Flash Drive path) => /storage/[NameOfTheFlashDrive]

It's the same if I use the Android path => content://com.android.externalstorage.documents/documents/[NameOfTheFlashDrive]
Same message > System.UnauthorizedAccessException Access to the path

I don't know how to proceed.

I have used => File.WriteAllText(filePath, Data);

And I have the permissions to write file in external storage.

The only solution is to use Plugin.Essential or PickerFile and save manually in the correct path.

If someone have a idea to proceed with the right way.

Thank you.
Zebiphire.

Sign In or Register to comment.