Download File From Storage Bucket But Access To The Path Is Denied

Customer has error while downloading from storage bucket.

[Issue]

Customer uses Download Storage File Activity to download file from Orchestrator storage bucket and same to the path Environment.CurrentDirectory+"\Temp\Config.xlsx".

It works good in Studio, however when the same process runs on Robot machine, it is constantly failed with error:

Access to the path '{packagepath}\{packagename}\{version}\content\Temp\filename.xlsx' is denied.

[Troubleshooting]

The Environment.CurrentDirectory indicates the current working directory of the process, while it runs in Studio, it has value of your process project. The file can be stored to the path without a problem because it's a valid path.

However, when it runs in robot machine, it has value of {Packages}\{PackageName}\{PackageVersion}\content\ where the project code is located, for example D:\UiPath\NuGet_Package\demo-process\1.0.55\content which is a path inside the nuget package file (actually it's a zip file), so it's is not a real path, so file can not be saved into this location..

[Resolution]

To avoid using Environment.CurrentDirectory in workflow to save file in Download Storage Bucket activity, instead, try to use a real path to store the file.