0
votes

I have created a service account for Google Drive API two months ago and was using it to upload files in weekly basics to a shared folder. From couple of days I am getting the below error while trying to upload files using this API

"The user has exceeded their Drive storage quota"

I tried to upload into another folder but still got the same issue. I am not sure if I am doing anything wrong here.

Thanks,Teja

2

2 Answers

2
votes

From your question it sounds like you are using a Service Account to proxy to a standard account. The first thing to do is to establish which account is out of quota, ie. is it the Service Account or is it the standard account? You can use the About.get method to see the used and available quota for each account. If it's the Service Account, it might be because the uploaded files are still owned by the Service Account. You might need to change their permission so they become owned by the standard account. The answer that @nicolas linked to is very helpful.

If you are using a Service Account as a proxy, consider not doing this because it's a bit hacky. Instead you should consider uploading directly to the standard account using a saved Refresh Token. There are pros and cons of each approach.