facebooktwittermenuarrow-up

GemBox Support Forum

Access to the path '/' is denied. Xamarin Forms

Code:

document.Save(filePath);
Error:

ex {System.UnauthorizedAccessException: Access to the path ‘/’ is denied. —> System.IO.IOException: Permission denied — End of inner exception stack trace — at System.IO.Enumeration.FileSystemEnumerator`1[TResult].CreateDirectoryHandle (System.String pa…}

Screenshot:

Hi Luis,

What is the value of your filePath?
Note, you cannot save your file to the system root.

Instead, please take a look at our Xamarin example, it shows how you can save to your “MyDocuments” folder.

Also, please check the File Storage and Access with Xamarin.Android documentation.
In the “Working with internal storage” section, you can read about the file’s processing (reading and writing) on internal storage.

Regards,
Mario

this method works well in versions smaller than android x, and the directory I use is the one in the example provided for xamarin

Hi Luis,

I’m afraid we were unable to reproduce this issue, we tried with both Android Pie (9.0) and Android Q (10.0).

Can you please send us a project that reproduces your issue so that we can investigate it?

Regards,
Mario