前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Google drive copy File

Google drive copy File

作者头像
拿我格子衫来
发布2022-01-24 11:23:58
4270
发布2022-01-24 11:23:58
举报
文章被收录于专栏:TopFETopFE

Files: copy

Note: Requires authorization.

Creates a copy of a file and applies any requested updates with patch semantics. Try it now.

Request

HTTP request

代码语言:javascript
复制
POST https://www.googleapis.com/drive/v3/files/fileId/copy

Parameters

Parameter name

Value

Description

Path parameters

fileId

string

The ID of the file.

Optional query parameters

fields

string

The paths of the fields you want included in the response. If not specified, the response includes a default set of fields specific to this method. For development you can use the special value * to return all fields, but you'll achieve greater performance by only selecting the fields you need. For more information see the partial responses documentation.

ignoreDefaultVisibility

boolean

Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. (Default: false)

keepRevisionForever

boolean

Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. (Default: false)

ocrLanguage

string

A language hint for OCR processing during image import (ISO 639-1 code).

supportsAllDrives

boolean

Warning: This item is deprecated. Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. (Default: false)

supportsTeamDrives

boolean

Warning: This item is deprecated. Deprecated use supportsAllDrives instead. (Default: false)

Authorization

This request requires authorization with at least one of the following scopes:

Scope

https://www.googleapis.com/auth/drive

https://www.googleapis.com/auth/drive.file

https://www.googleapis.com/auth/drive.appdata

https://www.googleapis.com/auth/drive.photos.readonly

Some scopes are restricted and require a security assessment for your app to use them. For more information, see the authentication and authorization page.

Request body

In the request body, supply a Files resource with the following properties:

Property name

Value

Description

Notes

Optional Properties

appProperties

object

A collection of arbitrary key-value pairs which are private to the requesting app. Entries with null values are cleared in update and copy requests.

writable

contentHints.thumbnail.image

bytes

The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).

writable

contentHints.thumbnail.mimeType

string

The MIME type of the thumbnail.

writable

copyRequiresWriterPermission

boolean

Whether the options to copy, print, or download this file, should be disabled for readers and commenters.

writable

description

string

A short description of the file.

writable

id

string

The ID of the file.

writable

mimeType

string

The MIME type of the file. Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided. The value cannot be changed unless a new revision is uploaded. If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible. The supported import formats are published in the About resource.

writable

modifiedTime

datetime

The last time the file was modified by anyone (RFC 3339 date-time). Note that setting modifiedTime will also update modifiedByMeTime for the user.

writable

name

string

The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.

writable

parents[]

list

The IDs of the parent folders which contain the file. If not specified as part of a create request, the file will be placed directly in the user's My Drive folder. If not specified as part of a copy request, the file will inherit any discoverable parents of the source file. Update requests must use the addParents and removeParents parameters to modify the parents list.

writable

properties

object

A collection of arbitrary key-value pairs which are visible to all apps. Entries with null values are cleared in update and copy requests.

writable

starred

boolean

Whether the user has starred the file.

writable

viewedByMeTime

datetime

The last time the file was viewed by the user (RFC 3339 date-time).

writable

writersCanShare

boolean

Whether users with only writer permission can modify the file's permissions. Not populated for items in shared drives.

writable

Response

If successful, this method returns a Files resource in the response body.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Files: copy
    • Request
      • HTTP request
      • Parameters
      • Authorization
      • Request body
    • Response
      • Try it!
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档