Reputation: 519
I have an app maker application using the Google Drive File picker widget. But uploading files does not work, I get a server rejected error.
API Upload Response
{
"errorMessage": {
"reason": "REQUEST_REJECTED",
"additionalInfo": {
"uploader_service.GoogleRupioAdditionalInfo": {
"completionInfo": {
"status": "REJECTED"
},
"requestRejectedInfo": {
"reasonDescription": "agent_rejected"
}
}
},
"upload_id": "UrqXRaPdnG_DZ0L-iDX5BJsG4XEg"
}
I believe the issue is the app's oauth scopes. It appears to only have read access which is insufficient for uploading new files.
I'd like to grant it full access https://www.googleapis.com/auth/drive but I'm not clear how to do this.
Upvotes: 0
Views: 630
Reputation: 5243
This behavior is a bug and it has been recently introduced as far as I'm aware. To be honest, the full drive scope should be granted when enabling the simple uploads feature in the drive picker but some reason it is not doing it. As a work around, you can put the following in any server script:
/***
Dummy function for drive full permissions
****/
function dummyForDrivePermission(){
var file = DriveApp.addFile();
}
The above code, will force appmaker to recognize that it needs to upload files, although you will never invoke the function but it will server the purpose of granting the scope you need.
Upvotes: 2