LXG
LXG

Reputation: 1987

Store file on google drive from server

I 've the follow simple scenario:

so I'd like to transfer daily some files to costumers google drive...

My question is: if a customer have pc disconnected or is not logged to my site is possible from my server upload a file into costumer google drive?

And if yes there's a limit of user or daily transfer?

p.s.

better if I can use A Google Drive spreadsheet and update data

thanks

Upvotes: 0

Views: 185

Answers (1)

Gerardo
Gerardo

Reputation: 3845

Yes it is possible, but there are many steps in between.

1.- You would need an application, so you can perform this operations through your app. check the documentation.

2.- You would need to set the offline access, this way you will be able to upload files even if the user is not logged. Oauth Offline access.

3.- The users (customers with Google Drive account) will have to authorize your application to access their Drive accounts. After this you will be able to get an access token and a refresh token.

4.- With the refresh token you can refresh the access token (it expires after an hour) without having the user to login again and get a new access token. (you have to store this refresh token)

5.- Now you can call the function Drive.Files.Insert in order to upload a file into the customer's Drive. When calling this function you need to provide the access token related to the user.

6.- There are limits that apply to the API. These quotas are against the application. If you make too many calls to the API, you may reach these limits for your application. You can check these limits in the Developer Console of your application.

I hope this helps. I know it's a lot of information but is the procedure you need to follow.

Upvotes: 2

Related Questions