Facing issue with System.UnauthorizedAccessException

Hello UiPath Team and UiPath Community,

I am downloading the file from Storage Bucket and storing in the Documents folder of my system.

I am using Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Local Robotics)

And passing this in Download storage bucket To file name and folder property.

But its giving me this error of access denied.

So, can you please help on this. It will very helpful for me.

Thanks and regards,
Rameshwar

@Rameshwar_Mahajan Could you please check the path value on the local panel or on the output panel using write line ?

@Rameshwar_Mahajan

Please print this value and check if the resulting path is the one you require?

Also copy the path that’s printed and manually try to navigate? Does it work?

1 Like

@manasrlenka25
I have checked the path value on the local panel, it is right path, the issue is with the access of that folder.

@sonaliaggarwal47
I have check the resulting path that I required.
Also I have navigated to that folder manually, but it does not working.

1 Like

Seems like Robot have no access to the folder location.

@Rameshwar_Mahajan,

There could be access restrictions to my documents by bot. Try savings it to another temporary folder over C drive or any other accessible folder path.

Also make sure you check if the folder exist before you try to save the file. You can use this code to check

Directory.Exists("c:\pasta")

Hi @Rameshwar_Mahajan

then it’s access problem.

Please choose a location that you can access even manually and use the same for your process too.

That way you will be able to get past the error.