maton google-drive file update

maton google-drive file update <file-id> [flags]

Update file metadata, parents, or binary content. Pass –metadata for arbitrary JSON and –name as a shorthand. –add-parents / –remove-parents move the file (comma-separated parent IDs). –file replaces the file’s binary content; combine with –name/–metadata to update both in one request. When –file is the only thing passed, the request sends raw bytes alone and leaves existing metadata untouched. Files above 5 MiB automatically use a chunked resumable session that survives transient network errors.

Options

--add-parents <string>
Comma-separated parent IDs to add (one of --name/--add-parents/--remove-parents/--metadata/--file)
--connection <string>
Connection ID to route through (Maton-Connection header)
--dry-run
Print the request that would be sent without executing it
--file <string>
Local file whose content replaces the Drive file's binary content (one of --name/--add-parents/--remove-parents/--metadata/--file)
-q, --jq <expression>
Filter JSON output using a jq expression
--json
Output raw JSON
--metadata <string>
Additional metadata as JSON, merged with --name (one of --name/--add-parents/--remove-parents/--metadata/--file)
--mime-type <string>
Override the detected MIME type for --file
--name <string>
New filename (one of --name/--add-parents/--remove-parents/--metadata/--file)
--paginate
Follow next_cursor and concatenate all pages (list commands only)
--remove-parents <string>
Comma-separated parent IDs to remove (one of --name/--add-parents/--remove-parents/--metadata/--file)
--supports-all-drives
Set when the file lives in a shared drive
-t, --template <string>
Format JSON output using a Go template; see "maton help formatting"

Options inherited from parent commands

-p, --profile <string>
Profile to use for this invocation (overrides the active profile; also reads MATON_PROFILE)

Examples

$ maton google-drive file update 1aBcD... --name 'Renamed.pdf'
$ maton google-drive file update 1aBcD... --add-parents 1NEW --remove-parents 1OLD
$ maton google-drive file update 1aBcD... --metadata '{"description":"final"}'
$ maton google-drive file update 1aBcD... --file ./report-v2.pdf
$ maton google-drive file update 1aBcD... --file ./report-v2.pdf --name 'v2.pdf'
$ maton google-drive file update 1aBcD... --file ./big.iso

See also