I cannot get the "Download Storage Files" from the RPA.cloud.google library to work. I want to download a jpg file from google cloud storage (gs://bucket-name/path/to/img.jpg) and copy the jpg file to a local directory

I am using the keyword “Download Storage Files” from the library RPA.cloud.google to download a jpg file from google cloud storage. I have the url which starts with gs:// and the bucket name as well as the path to the jpg image in the bucket e.g gs://bucket-name/path/to/img.jpg. For the first argument in the keyword “Download Storage Files” I put the bucket name and the second argument I put the path to jpg file but it does not download the file.

Could you please tell me why this keyword is not working.

Have you remembered to initialize your storage with correct keys? And have you also checked from log.html what actual error is, so what Google is complaining?

Yes it is initialized. The test case does pass but it fails to download the file from the bucket. The “Download Storage Files” returns the files it cannot download and after doing a “log to console” of the result it showed that the file failed to download.

A example of how I would use the download storage files keyword is:

${files_not_downloaded} Download Storage Files ${BUCKET_NAME} /path/to/file.jpg

log to console ${files_not_downloaded}

Have you noticed how example code in documentation looks like: RPA.Cloud.Google library | Robocorp documentation

Note that there are “dictionary form” and “list form” …

I have managed to get it to work however it only works with files that are directly in the bucket directory e.g. bucket-name/img.jpg and not in a sub directories e.g bucket-name/path/to/img.jpg.

Do you know whether this is keyword is only limited to files in the bucket directory or does it also work with sub directories in the bucket?