All Products
Search
Document Center

Drive and Photo Service:UpdateFile

Last Updated:Aug 04, 2025

Modifies the information about a file instead of the file data.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

POST /v2/file/update HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
bodyobjectNo

The request parameters.

drive_idstringYes

The drive ID.

1
file_idstringYes

The file ID.

9520943DC264
namestringNo

The name of the file. The name can be up to 1,024 bytes in length based on the UTF-8 encoding rule.

a.jpg
descriptionstringNo

The description of the file. The description can be up to 1,024 characters in length.

labelsarrayNo

The tags of the file. You can specify up to 100 tags.

stringNo

The tag of the file. The tag can be up to 128 characters in length.

check_name_modestringNo

The processing method that is used if the file that you want to modify has the same name as an existing file on the cloud. Valid values:

ignore: allows you to modify the file by using the same name as an existing file on the cloud.

auto_rename: automatically renames the file that has the same name on the cloud. By default, the current point in time is added to the end of the file name. Example: xxx_20060102_150405.

refuse: does not modify the file that you want to modify but returns the information about the file that has the same name on the cloud.

Default value: ignore.

ignore
local_modified_atstringNo

The local time when the file was modified. The time is in the yyyy-MM-ddTHH:mm:ssZ format based on the UTC+0 time zone.

2019-08-20T06:51:27.292Z
hiddenbooleanNo

Specifies whether to hide the file.

true
starredbooleanNo

Specifies whether to add the file to favorites.

true

Response parameters

ParameterTypeDescriptionExample
File

The information about the file.

Error codes

For a list of error codes, visit the Service error codes.