Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-722-drive-upload-shared-drives.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 4 additions & 2 deletions crates/google-workspace-cli/src/helpers/drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -105,7 +107,7 @@ TIPS:
executor::execute_method(
doc,
create_method,
None,
Some(r#"{"supportsAllDrives": true}"#),
Some(&body_str),
token.as_deref(),
auth_method,
Expand Down
Loading