Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating fields, some fields might be changed automatically, such as modifiedDate
. This method supports patch semantics. This method supports an /upload URI and accepts uploaded media with the following characteristics: - Maximum file size: 5,120 GB - Accepted Media MIME types:*/*
Note: Specify a valid MIME type, rather than the literal */*
value. The literal */*
is only used to indicate that any valid MIME type can be uploaded. For more information on uploading files, see Upload file data.
Scopes
You will need authorization for at least one of the following scopes to make a valid call:
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/drive.appdata
- https://www.googleapis.com/auth/drive.apps.readonly
- https://www.googleapis.com/auth/drive.file
- https://www.googleapis.com/auth/drive.metadata
- https://www.googleapis.com/auth/drive.scripts
If unset, the scope for this method defaults to https://www.googleapis.com/auth/drive.
You can set the scope for this method like this: drive2 --scope <scope> files update ...
Required Scalar Argument
- <file-id> (string)
- The ID of the file to update.
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
File:
alternate-link: string
app-data-contents: boolean
can-comment: boolean
can-read-revisions: boolean
capabilities:
can-accept-ownership: boolean
can-add-children: boolean
can-add-folder-from-another-drive: boolean
can-add-my-drive-parent: boolean
can-change-copy-requires-writer-permission: boolean
can-change-restricted-download: boolean
can-change-security-update-enabled: boolean
can-comment: boolean
can-copy: boolean
can-delete: boolean
can-delete-children: boolean
can-download: boolean
can-edit: boolean
can-list-children: boolean
can-modify-content: boolean
can-modify-content-restriction: boolean
can-modify-editor-content-restriction: boolean
can-modify-labels: boolean
can-modify-owner-content-restriction: boolean
can-move-children-out-of-drive: boolean
can-move-children-out-of-team-drive: boolean
can-move-children-within-drive: boolean
can-move-children-within-team-drive: boolean
can-move-item-into-team-drive: boolean
can-move-item-out-of-drive: boolean
can-move-item-out-of-team-drive: boolean
can-move-item-within-drive: boolean
can-move-item-within-team-drive: boolean
can-move-team-drive-item: boolean
can-read-drive: boolean
can-read-labels: boolean
can-read-revisions: boolean
can-read-team-drive: boolean
can-remove-children: boolean
can-remove-content-restriction: boolean
can-remove-my-drive-parent: boolean
can-rename: boolean
can-share: boolean
can-trash: boolean
can-trash-children: boolean
can-untrash: boolean
copy-requires-writer-permission: boolean
copyable: boolean
created-date: string
default-open-with-link: string
description: string
download-url: string
drive-id: string
editable: boolean
embed-link: string
etag: string
explicitly-trashed: boolean
export-links: { string: string }
file-extension: string
file-size: string
folder-color-rgb: string
full-file-extension: string
has-augmented-permissions: boolean
has-thumbnail: boolean
head-revision-id: string
icon-link: string
id: string
image-media-metadata:
aperture: number
camera-make: string
camera-model: string
color-space: string
date: string
exposure-bias: number
exposure-mode: string
exposure-time: number
flash-used: boolean
focal-length: number
height: integer
iso-speed: integer
lens: string
location:
altitude: number
latitude: number
longitude: number
max-aperture-value: number
metering-mode: string
rotation: integer
sensor: string
subject-distance: integer
white-balance: string
width: integer
indexable-text:
text: string
is-app-authorized: boolean
kind: string
labels:
hidden: boolean
modified: boolean
restricted: boolean
starred: boolean
trashed: boolean
viewed: boolean
last-modifying-user:
display-name: string
email-address: string
is-authenticated-user: boolean
kind: string
permission-id: string
picture:
url: string
last-modifying-user-name: string
last-viewed-by-me-date: string
link-share-metadata:
security-update-eligible: boolean
security-update-enabled: boolean
marked-viewed-by-me-date: string
md5-checksum: string
mime-type: string
modified-by-me-date: string
modified-date: string
open-with-links: { string: string }
original-filename: string
owned-by-me: boolean
owner-names: [string]
permission-ids: [string]
quota-bytes-used: string
resource-key: string
self-link: string
sha1-checksum: string
sha256-checksum: string
shareable: boolean
shared: boolean
shared-with-me-date: string
sharing-user:
display-name: string
email-address: string
is-authenticated-user: boolean
kind: string
permission-id: string
picture:
url: string
shortcut-details:
target-id: string
target-mime-type: string
target-resource-key: string
spaces: [string]
team-drive-id: string
thumbnail:
image: string
mime-type: string
thumbnail-link: string
thumbnail-version: string
title: string
trashed-date: string
trashing-user:
display-name: string
email-address: string
is-authenticated-user: boolean
kind: string
permission-id: string
picture:
url: string
user-permission:
additional-roles: [string]
auth-key: string
deleted: boolean
domain: string
email-address: string
etag: string
expiration-date: string
id: string
kind: string
name: string
pending-owner: boolean
photo-link: string
role: string
self-link: string
type: string
value: string
view: string
with-link: boolean
version: string
video-media-metadata:
duration-millis: string
height: integer
width: integer
web-content-link: string
web-view-link: string
writers-can-share: boolean
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r . alternate-link=dolores
- Output only. A link for opening the file in a relevant Google editor or viewer.
app-data-contents=true
- Output only. Whether this file is in the Application Data folder.
can-comment=false
- Output only. Deprecated: Use
capabilities/canComment
instead.
- Output only. Deprecated: Use
can-read-revisions=true
- Output only. Deprecated: Use
capabilities/canReadRevisions
instead.
- Output only. Deprecated: Use
capabilities can-accept-ownership=false
- Output only. Whether the current user is the pending owner of the file. Not populated for shared drive files.
can-add-children=true
- Output only. Whether the current user can add children to this folder. This is always false when the item is not a folder.
can-add-folder-from-another-drive=true
- Output only. Whether the current user can add a folder from another drive (different shared drive or My Drive) to this folder. This is false when the item is not a folder. Only populated for items in shared drives.
can-add-my-drive-parent=true
- Output only. Whether the current user can add a parent for the item without removing an existing parent in the same request. Not populated for shared drive files.
can-change-copy-requires-writer-permission=true
- Output only. Whether the current user can change the
copyRequiresWriterPermission
restriction of this file.
- Output only. Whether the current user can change the
can-change-restricted-download=true
- Output only. Deprecated.
can-change-security-update-enabled=false
- Output only. Whether the current user can change the securityUpdateEnabled field on link share metadata.
can-comment=true
- Output only. Whether the current user can comment on this file.
can-copy=false
- Output only. Whether the current user can copy this file. For an item in a shared drive, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder.
can-delete=true
- Output only. Whether the current user can delete this file.
can-delete-children=true
- Output only. Whether the current user can delete children of this folder. This is false when the item is not a folder. Only populated for items in shared drives.
can-download=true
- Output only. Whether the current user can download this file.
can-edit=true
- Output only. Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see
canChangeCopyRequiresWriterPermission
orcanModifyContent
.
- Output only. Whether the current user can edit this file. Other factors may limit the type of changes a user can make to a file. For example, see
can-list-children=false
- Output only. Whether the current user can list the children of this folder. This is always false when the item is not a folder.
can-modify-content=true
- Output only. Whether the current user can modify the content of this file.
can-modify-content-restriction=true
- Deprecated: Output only. Use one of
canModifyEditorContentRestriction
,canModifyOwnerContentRestriction
orcanRemoveContentRestriction
.
- Deprecated: Output only. Use one of
can-modify-editor-content-restriction=true
- Output only. Whether the current user can add or modify content restrictions on the file which are editor restricted.
can-modify-labels=false
- Output only. Whether the current user can modify the labels on the file.
can-modify-owner-content-restriction=true
- Output only. Whether the current user can add or modify content restrictions which are owner restricted.
can-move-children-out-of-drive=true
- Output only. Whether the current user can move children of this folder outside of the shared drive. This is false when the item is not a folder. Only populated for items in shared drives.
can-move-children-out-of-team-drive=false
- Output only. Deprecated: Use
canMoveChildrenOutOfDrive
instead.
- Output only. Deprecated: Use
can-move-children-within-drive=true
- Output only. Whether the current user can move children of this folder within this drive. This is false when the item is not a folder. Note that a request to move the child may still fail depending on the current user's access to the child and to the destination folder.
can-move-children-within-team-drive=true
- Output only. Deprecated: Use
canMoveChildrenWithinDrive
instead.
- Output only. Deprecated: Use
can-move-item-into-team-drive=false
- Output only. Deprecated: Use
canMoveItemOutOfDrive
instead.
- Output only. Deprecated: Use
can-move-item-out-of-drive=true
- Output only. Whether the current user can move this item outside of this drive by changing its parent. Note that a request to change the parent of the item may still fail depending on the new parent that is being added.
can-move-item-out-of-team-drive=false
- Output only. Deprecated: Use
canMoveItemOutOfDrive
instead.
- Output only. Deprecated: Use
can-move-item-within-drive=true
- Output only. Whether the current user can move this item within this drive. Note that a request to change the parent of the item may still fail depending on the new parent that is being added and the parent that is being removed.
can-move-item-within-team-drive=true
- Output only. Deprecated: Use
canMoveItemWithinDrive
instead.
- Output only. Deprecated: Use
can-move-team-drive-item=false
- Output only. Deprecated: Use
canMoveItemWithinDrive
orcanMoveItemOutOfDrive
instead.
- Output only. Deprecated: Use
can-read-drive=true
- Output only. Whether the current user can read the shared drive to which this file belongs. Only populated for items in shared drives.
can-read-labels=true
- Output only. Whether the current user can read the labels on the file.
can-read-revisions=false
- Output only. Whether the current user can read the revisions resource of this file. For a shared drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read.
can-read-team-drive=true
- Output only. Deprecated: Use
canReadDrive
instead.
- Output only. Deprecated: Use
can-remove-children=false
- Output only. Whether the current user can remove children from this folder. This is always false when the item is not a folder. For a folder in a shared drive, use
canDeleteChildren
orcanTrashChildren
instead.
- Output only. Whether the current user can remove children from this folder. This is always false when the item is not a folder. For a folder in a shared drive, use
can-remove-content-restriction=true
- Output only. Whether there is a content restriction on the file that can be removed by the current user.
can-remove-my-drive-parent=true
- Output only. Whether the current user can remove a parent from the item without adding another parent in the same request. Not populated for shared drive files.
can-rename=false
- Output only. Whether the current user can rename this file.
can-share=true
- Output only. Whether the current user can modify the sharing settings for this file.
can-trash=true
- Output only. Whether the current user can move this file to trash.
can-trash-children=false
- Output only. Whether the current user can trash children of this folder. This is false when the item is not a folder. Only populated for items in shared drives.
-
can-untrash=true
- Output only. Whether the current user can restore this file from trash.
-
.. copy-requires-writer-permission=true
- Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
copyable=true
- Output only. Deprecated: Use
capabilities/canCopy
instead.
- Output only. Deprecated: Use
created-date=et
- Create time for this file (formatted RFC 3339 timestamp).
default-open-with-link=et
- Output only. A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used.
description=lorem
- A short description of the file.
download-url=et
- Output only. Short lived download URL for the file. This field is only populated for files with content stored in Google Drive; it is not populated for Google Docs or shortcut files.
drive-id=lorem
- Output only. ID of the shared drive the file resides in. Only populated for items in shared drives.
editable=true
- Output only. Deprecated: Use
capabilities/canEdit
instead.
- Output only. Deprecated: Use
embed-link=eos
- Output only. A link for embedding the file.
etag=magna
- Output only. ETag of the file.
explicitly-trashed=true
- Output only. Whether this file has been explicitly trashed, as opposed to recursively trashed.
export-links=key=stet
- Output only. Links for exporting Docs Editors files to specific formats.
- the value will be associated with the given
key
file-extension=sed
- Output only. The final component of
fullFileExtension
with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
- Output only. The final component of
file-size=eirmod
- Output only. Size in bytes of blobs and first party editor files. Won't be populated for files that have no size, like shortcuts and folders.
folder-color-rgb=ea
- Folder color as an RGB hex string if the file is a folder or a shortcut to a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette.
full-file-extension=ipsum
- Output only. The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
has-augmented-permissions=false
- Output only. Whether there are permissions directly on this file. This field is only populated for items in shared drives.
has-thumbnail=true
- Output only. Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field.
head-revision-id=justo
- Output only. The ID of the file's head revision. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
icon-link=clita
- Output only. A link to the file's icon.
id=stet
- The ID of the file.
image-media-metadata aperture=0.32722640056533014
- Output only. The aperture used to create the photo (f-number).
camera-make=sed
- Output only. The make of the camera used to create the photo.
camera-model=et
- Output only. The model of the camera used to create the photo.
color-space=no
- Output only. The color space of the photo.
date=sit
- Output only. The date and time the photo was taken (EXIF format timestamp).
exposure-bias=0.12052507614381369
- Output only. The exposure bias of the photo (APEX value).
exposure-mode=sea
- Output only. The exposure mode used to create the photo.
exposure-time=0.7165586728755385
- Output only. The length of the exposure, in seconds.
flash-used=false
- Output only. Whether a flash was used to create the photo.
focal-length=0.09075083521612615
- Output only. The focal length used to create the photo, in millimeters.
height=81
- Output only. The height of the image in pixels.
iso-speed=65
- Output only. The ISO speed used to create the photo.
lens=eos
- Output only. The lens used to create the photo.
location altitude=0.97361164390737
- Output only. The altitude stored in the image.
latitude=0.49962163113163993
- Output only. The latitude stored in the image.
-
longitude=0.714971087865869
- Output only. The longitude stored in the image.
-
.. max-aperture-value=0.9193415034852493
- Output only. The smallest f-number of the lens at the focal length used to create the photo (APEX value).
metering-mode=sed
- Output only. The metering mode used to create the photo.
rotation=47
- Output only. The number of clockwise 90 degree rotations applied from the image's original orientation.
sensor=dolor
- Output only. The type of sensor used to create the photo.
subject-distance=21
- Output only. The distance to the subject of the photo, in meters.
white-balance=et
- Output only. The white balance mode used to create the photo.
-
width=27
- Output only. The width of the image in pixels.
-
..indexable-text text=duo
- The text to be indexed for this file.
-
.. is-app-authorized=false
- Output only. Whether the file was created or opened by the requesting app.
kind=voluptua.
- Output only. The type of file. This is always
drive#file
.
- Output only. The type of file. This is always
labels hidden=true
- Output only. Deprecated.
modified=false
- Output only. Whether the file has been modified by this user.
restricted=true
- Output only. Deprecated: Use
copyRequiresWriterPermission
instead.
- Output only. Deprecated: Use
starred=true
- Whether this file is starred by the user.
trashed=false
- Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files.
-
viewed=true
- Whether this file has been viewed by this user.
-
..last-modifying-user display-name=ut
- Output only. A plain text displayable name for this user.
email-address=voluptua.
- Output only. The email address of the user.
is-authenticated-user=true
- Output only. Whether this user is the same as the authenticated user for whom the request was made.
kind=lorem
- Output only. This is always
drive#user
.
- Output only. This is always
permission-id=amet
- Output only. The user's ID as visible in the permissions collection.
-
picture url=sed
- Output Only. A URL that points to a profile picture of this user.
-
... last-modifying-user-name=rebum.
- Output only. Name of the last user to modify this file.
last-viewed-by-me-date=eirmod
- Last time this file was viewed by the user (formatted RFC 3339 timestamp).
link-share-metadata security-update-eligible=true
- Output only. Whether the file is eligible for security update.
-
security-update-enabled=true
- Output only. Whether the security update is enabled for this file.
-
.. marked-viewed-by-me-date=kasd
- Deprecated.
md5-checksum=stet
- Output only. An MD5 checksum for the content of this file. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
mime-type=accusam
- The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type.
modified-by-me-date=lorem
- Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date.
modified-date=et
- Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set.
open-with-links=key=nonumy
- Output only. A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used.
- the value will be associated with the given
key
original-filename=kasd
- The original filename of the uploaded content if available, or else the original value of the
title
field. This is only available for files with binary content in Google Drive.
- The original filename of the uploaded content if available, or else the original value of the
owned-by-me=true
- Output only. Whether the file is owned by the current user. Not populated for items in shared drives.
owner-names=et
- Output only. Name(s) of the owner(s) of this file. Not populated for items in shared drives.
- Each invocation of this argument appends the given value to the array.
permission-ids=dolor
- Output only. List of permission IDs for users with access to this file.
- Each invocation of this argument appends the given value to the array.
quota-bytes-used=elitr
- Output only. The number of quota bytes used by this file.
resource-key=sanctus
- Output only. A key needed to access the item via a shared link.
self-link=dolor
- Output only. A link back to this file.
sha1-checksum=sea
- Output only. The SHA1 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
sha256-checksum=sanctus
- Output only. The SHA256 checksum associated with this file, if available. This field is only populated for files with content stored in Google Drive; it is not populated for Docs Editors or shortcut files.
shareable=true
- Output only. Deprecated: Use
capabilities/canShare
instead.
- Output only. Deprecated: Use
shared=true
- Output only. Whether the file has been shared. Not populated for items in shared drives.
shared-with-me-date=nonumy
- Time at which this file was shared with the user (formatted RFC 3339 timestamp).
sharing-user display-name=duo
- Output only. A plain text displayable name for this user.
email-address=sed
- Output only. The email address of the user.
is-authenticated-user=true
- Output only. Whether this user is the same as the authenticated user for whom the request was made.
kind=takimata
- Output only. This is always
drive#user
.
- Output only. This is always
permission-id=et
- Output only. The user's ID as visible in the permissions collection.
-
picture url=tempor
- Output Only. A URL that points to a profile picture of this user.
-
...shortcut-details target-id=nonumy
- The ID of the file that this shortcut points to.
target-mime-type=sanctus
- Output only. The MIME type of the file that this shortcut points to. The value of this field is a snapshot of the target's MIME type, captured when the shortcut is created.
-
target-resource-key=labore
- Output only. The ResourceKey for the target file.
-
.. spaces=est
- Output only. The list of spaces which contain the file. Supported values are
drive
,appDataFolder
andphotos
. - Each invocation of this argument appends the given value to the array.
- Output only. The list of spaces which contain the file. Supported values are
team-drive-id=sadipscing
- Output only. Deprecated: Use
driveId
instead.
- Output only. Deprecated: Use
thumbnail image=accusam
- The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5.
-
mime-type=elitr
- The MIME type of the thumbnail.
-
.. thumbnail-link=sit
- Output only. A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in
Files.thumbnailLink
must be fetched using a credentialed request.
- Output only. A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. If the file isn't shared publicly, the URL returned in
thumbnail-version=invidunt
- Output only. The thumbnail version for use in thumbnail cache invalidation.
title=dolore
- The title of this file. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the title is constant.
trashed-date=et
- The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for items in shared drives.
trashing-user display-name=tempor
- Output only. A plain text displayable name for this user.
email-address=nonumy
- Output only. The email address of the user.
is-authenticated-user=false
- Output only. Whether this user is the same as the authenticated user for whom the request was made.
kind=et
- Output only. This is always
drive#user
.
- Output only. This is always
permission-id=et
- Output only. The user's ID as visible in the permissions collection.
-
picture url=nonumy
- Output Only. A URL that points to a profile picture of this user.
-
...user-permission additional-roles=sit
- Additional roles for this user. Only
commenter
is currently allowed, though more may be supported in the future. - Each invocation of this argument appends the given value to the array.
- Additional roles for this user. Only
auth-key=lorem
- Output only. Deprecated.
deleted=true
- Output only. Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
domain=sea
- Output only. The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is
user
,group
ordomain
.
- Output only. The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is
email-address=duo
- Output only. The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is
user
orgroup
.
- Output only. The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is
etag=sea
- Output only. The ETag of the permission.
expiration-date=stet
- The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: - They can only be set on user and group permissions - The date must be in the future - The date cannot be more than a year in the future - The date can only be set on drive.permissions.update or drive.permissions.patch requests
id=erat
- The ID of the user this permission refers to, and identical to the
permissionId
in the About and Files resources. When making adrive.permissions.insert
request, exactly one of theid
orvalue
fields must be specified unless the permission type isanyone
, in which case bothid
andvalue
are ignored.
- The ID of the user this permission refers to, and identical to the
kind=eirmod
- Output only. This is always
drive#permission
.
- Output only. This is always
name=no
- Output only. The name for this permission.
pending-owner=true
- Whether the account associated with this permission is a pending owner. Only populated for
user
type permissions for files that are not in a shared drive.
- Whether the account associated with this permission is a pending owner. Only populated for
photo-link=accusam
- Output only. A link to the profile photo, if available.
role=et
- The primary role for this user. While new values may be supported in the future, the following are currently allowed: *
owner
*organizer
*fileOrganizer
*writer
*reader
- The primary role for this user. While new values may be supported in the future, the following are currently allowed: *
self-link=sit
- Output only. A link back to this permission.
type=lorem
- The account type. Allowed values are: *
user
*group
*domain
*anyone
- The account type. Allowed values are: *
value=et
- The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a
drive.permissions.insert
request, exactly one of theid
orvalue
fields must be specified unless the permission type isanyone
, in which case bothid
andvalue
are ignored.
- The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a
view=tempor
- Indicates the view for this permission. Only populated for permissions that belong to a view.
published
is the only supported value.
- Indicates the view for this permission. Only populated for permissions that belong to a view.
-
with-link=true
- Whether the link is required for this permission.
-
.. version=vero
- Output only. A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user.
video-media-metadata duration-millis=at
- Output only. The duration of the video in milliseconds.
height=81
- Output only. The height of the video in pixels.
-
width=34
- Output only. The width of the video in pixels.
-
.. web-content-link=et
- Output only. A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials.
web-view-link=lorem
- Output only. A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting.
writers-can-share=true
- Whether writers can share the document with other users. Not populated for items in shared drives.
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Required Upload Flags
This method supports the upload of data, which requires all of the following flags to be set:
- -u simple
- simple - Upload media all at once.
- -f file
- Path to file to upload. It must be seekable.
The following flag may be set:
- -m mime
- the mime type, like 'application/octet-stream', which is the default
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional Method Properties
You may set the following properties to further configure the call. Please note that -p
is followed by one
or more key-value-pairs, and is called like this -p k1=v1 k2=v2
even though the listing below repeats the
-p
for completeness.
-
-p add-parents=string
- Comma-separated list of parent IDs to add.
-
-p convert=boolean
- Deprecated: This parameter has no function.
-
-p enforce-single-parent=boolean
- Deprecated: Adding files to multiple folders is no longer supported. Use
shortcuts
instead.
- Deprecated: Adding files to multiple folders is no longer supported. Use
-
-p include-labels=string
- A comma-separated list of IDs of labels to include in the
labelInfo
part of the response.
- A comma-separated list of IDs of labels to include in the
-
-p include-permissions-for-view=string
- Specifies which additional view's permissions to include in the response. Only
published
is supported.
- Specifies which additional view's permissions to include in the response. Only
-
-p modified-date-behavior=string
- Determines the behavior in which
modifiedDate
is updated. This overridessetModifiedDate
.
- Determines the behavior in which
-
-p new-revision=boolean
- Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center.
-
-p ocr=boolean
- Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
-
-p ocr-language=string
- If ocr is true, hints at the language to use. Valid values are BCP 47 codes.
-
-p pinned=boolean
- Whether to pin the new revision. A file can have a maximum of 200 pinned revisions.
-
-p remove-parents=string
- Comma-separated list of parent IDs to remove.
-
-p set-modified-date=boolean
- Whether to set the modified date using the value supplied in the request body. Setting this field to
true
is equivalent tomodifiedDateBehavior=fromBodyOrNow
, andfalse
is equivalent tomodifiedDateBehavior=now
. To prevent any changes to the modified date setmodifiedDateBehavior=noChange
.
- Whether to set the modified date using the value supplied in the request body. Setting this field to
-
-p supports-all-drives=boolean
- Whether the requesting application supports both My Drives and shared drives.
-
-p supports-team-drives=boolean
- Deprecated: Use
supportsAllDrives
instead.
- Deprecated: Use
-
-p timed-text-language=string
- The language of the timed text.
-
-p timed-text-track-name=string
- The timed text track name.
-
-p update-viewed-date=boolean
- Whether to update the view date after successfully updating the file.
-
-p use-content-as-indexable-text=boolean
- Whether to use the content as indexable text.
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").