From 51ba45565bddd27b356b1dbddb3cdefcf5a51b5f Mon Sep 17 00:00:00 2001 From: Hoyt Harness <2735828+hoyt-harness@users.noreply.github.com> Date: Wed, 22 Apr 2026 12:21:17 -0500 Subject: [PATCH] fix(drive): pass supportsAllDrives=true in +upload so Shared Drive folders work Previously the files.create call omitted supportsAllDrives, causing the API to reject --parent values that point to Shared Drive folders (404/403 even when the user had access). The parameter is harmless for My Drive uploads. Fixes #722 --- .changeset/fix-722-drive-upload-shared-drives.md | 5 +++++ crates/google-workspace-cli/src/helpers/drive.rs | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/fix-722-drive-upload-shared-drives.md diff --git a/.changeset/fix-722-drive-upload-shared-drives.md b/.changeset/fix-722-drive-upload-shared-drives.md new file mode 100644 index 00000000..78fe5711 --- /dev/null +++ b/.changeset/fix-722-drive-upload-shared-drives.md @@ -0,0 +1,5 @@ +--- +"@googleworkspace/cli": patch +--- + +`drive +upload`: pass `supportsAllDrives=true` on every upload request so files can be placed inside Shared Drive folders via `--parent`. Previously, any `--parent` pointing to a Shared Drive folder was rejected by the API with a 404 or permission error even when the user had access. diff --git a/crates/google-workspace-cli/src/helpers/drive.rs b/crates/google-workspace-cli/src/helpers/drive.rs index 68662ec6..d55a6931 100644 --- a/crates/google-workspace-cli/src/helpers/drive.rs +++ b/crates/google-workspace-cli/src/helpers/drive.rs @@ -56,11 +56,13 @@ impl Helper for DriveHelper { EXAMPLES: gws drive +upload ./report.pdf gws drive +upload ./report.pdf --parent FOLDER_ID + gws drive +upload ./report.pdf --parent SHARED_DRIVE_FOLDER_ID gws drive +upload ./data.csv --name 'Sales Data.csv' TIPS: MIME type is detected automatically. - Filename is inferred from the local path unless --name is given.", + Filename is inferred from the local path unless --name is given. + Shared Drive folders are supported: pass the folder ID via --parent.", ), ); cmd @@ -105,7 +107,7 @@ TIPS: executor::execute_method( doc, create_method, - None, + Some(r#"{"supportsAllDrives": true}"#), Some(&body_str), token.as_deref(), auth_method,