Help Me! I want to know how to use "Drive Upload File" keyword

Hello I want to know how to setup before use this keyword “Drive upload File” step by step. i want upload file to google drive.

Now i can read and write from google sheet and next i want upload file to google drive. But i don’t know how to use “Drive Upload File .Thank you

Thank you

@tr.inpha Welcome to the Forum! :heart:

What is the error message you are getting ? Does your directory Robocorp already exist in the Drive ? If not, then you need to use make_dir=True parameter.

Another possible “gotcha” is that you need to share your drive folder with the user defined in the service_account.json - the client_email property in the json.

yeah i have already Robocorp Folder in my Google Drive

I have error message. I don’t know what happened to us.

You can show me for example code

Sorry. My English isn’t that good.

already share account and i have service_account.json in config

and your account has access to Drive API (and you have enabled API for your account) ?

yeah am enable too
and now i have new error

Sorry I think I have silly bug in the library (for the Google Drive). I will check and test it further and will make a new release by tomorrow the latest.

but i think myself mistake maybe i do something wrong haha :sweat_smile:

thank you so much mika.

have a nice day.

sorry mr.mika i have the last one question.

"Init Drive Client" or “Init Sheets Client” Keyword it use the same file service_account.json ?

oh sorry my english is bad :disappointed_relieved:

the same service_account.json works with both Sheets and Drive if they have sufficient access profiles and both APIs are enabled

i follow setting service_account.json from this link
https://robocorp.com/docs/development-guide/google-sheets/interacting-with-google-sheets
it working good for Init Sheets Client
but Init Drive Client not working

Thank you mr.mika i’m waiting for last update from you and i will try.

@tr.inpha now there is rpaframework release 9.3.1

I had to add a new keyword for Drive Init, Init Drive Client Service Account to fix this issue.

The library will be refactored and then keywords will most probably change, but I did not want to do that now and this was a quick fix for your problem.

Here is example of using service account from Vault and from file.

google_cloud_example.robot (1.5 KB)

Yeahhhhh!!! mr.mika. it working good i can upload file to google drive is success.

Thank you so much for help me. :dizzy: :dizzy: :star_struck: :star_struck:

2 Likes

mr.mika I’m sorry to bother you again.
totally it working good upload success but I have a new little problem. i want to know why google drive is not to know file type.
i’m using Drive Upload File keyword

@tr.inpha seems like there are something more to fix… :sweat_smile:

… and now there is 9.3.3 release which should fix this issue

9.3.3 can’t upload file to google drive. and have new error.
but i try 9.3.1 with same code it run pass and upload success