Skip to content

Google 云端硬盘文件操作#

¥Google Drive File operations

使用此操作在 Google 云端硬盘中创建、删除、更改和管理文件。有关 Google Drive 节点本身的更多信息,请参阅 Google 云端硬盘

¥Use this operation to create, delete, change, and manage files in Google Drive. Refer to Google Drive for more information on the Google Drive node itself.

This node can be used as an AI tool

This node can be used to enhance the capabilities of an AI agent. When used in this way, many parameters can be set automatically, or with information directed by AI - find out more in the AI tool parameters documentation.

复制文件#

¥Copy a file

使用此操作将文件复制到云端硬盘。

¥Use this operation to copy a file to a drive.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“复制”。

¥Operation: Select Copy.

  • 文件:选择要复制的文件。

¥File: Choose a file you want to copy.

  • 选择“从列表中选择标题”以从下拉列表中选择标题,选择“通过 URL”以输入文件 URL,或选择“通过 ID”以输入 fileId

    ¥Select From list to choose the title from the dropdown list, By URL to enter the URL of the file, or By ID to enter the fileId.

  • 你可以在可共享的 Google 云端硬盘文件 URL 中找到 fileIdhttps://docs.google.com/document/d/fileId/edit#gid=0。在 Google 云端硬盘中,选择“共享”>“复制链接”以获取可共享文件的 URL。

    ¥You can find the fileId in a shareable Google Drive file URL: https://docs.google.com/document/d/fileId/edit#gid=0. In your Google Drive, select Share > Copy link to get the shareable file URL.

  • 文件名:文件新副本的名称。

¥File Name: The name to use for the new copy of the file.

  • 复制到同一文件夹:选择是否将文件复制到同一文件夹。如果禁用此功能,请进行以下设置:

¥Copy In The Same Folder: Choose whether to copy the file to the same folder. If disabled, set the following:

  • 父驱动器:选择“从列表”从下拉列表中选择驱动器,选择“按 URL”输入驱动器的 URL,或选择“按 ID”输入 driveId

    ¥Parent Drive: Select From list to choose the drive from the dropdown list, By URL to enter the URL of the drive, or By ID to enter the driveId.

  • 父文件夹:选择“从列表”从下拉列表中选择文件夹,选择“按 URL”输入文件夹的 URL,或选择“按 ID”输入 folderId

    ¥Parent Folder: Select From list to choose the folder from the dropdown list, By URL to enter the URL of the folder, or By ID to enter the folderId.

  • 你可以通过在浏览器中访问共享云端硬盘或文件夹,并复制 URL 的最后一个部分来找到 driveIdfolderIDhttps://drive.google.com/drive/u/1/folders/driveId

    ¥You can find the driveId and folderID by visiting the shared drive or folder in your browser and copying the last URL component: https://drive.google.com/drive/u/1/folders/driveId.

选项#

¥Options

  • 复制需要写入权限:选择是否允许读者和评论者复制、打印或下载新文件。

¥Copy Requires Writer Permissions: Select whether to enable readers and commenters to copy, print, or download the new file.

  • 描述:文件的简短描述。

¥Description: A short description of the file.

请参阅 方法:files.copy | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: files.copy | Google Drive API documentation for more information.

从文本创建#

¥Create from text

使用此操作根据提供的文本在云端硬盘中创建新文件。

¥Use this operation to create a new file in a drive from provided text.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“从文本创建”。

¥Operation: Select Create From Text.

  • 文件内容:输入用于创建新文件的文件内容。

¥File Content: Enter the file content to use to create the new file.

  • 文件名:新文件的名称。

¥File Name: The name to use for the new file.

  • 父驱动器:选择“从列表”从下拉列表中选择驱动器,选择“按 URL”输入驱动器的 URL,或选择“按 ID”输入 driveId

¥Parent Drive: Select From list to choose the drive from the dropdown list, By URL to enter the URL of the drive, or By ID to enter the driveId.

  • 父文件夹:选择“从列表”从下拉列表中选择文件夹,选择“按 URL”输入文件夹的 URL,或选择“按 ID”输入 folderId

¥Parent Folder: Select From list to choose the folder from the dropdown list, By URL to enter the URL of the folder, or By ID to enter the folderId.

你可以通过在浏览器中访问共享云端硬盘或文件夹,并复制 URL 的最后一个部分来找到 driveIdfolderIDhttps://drive.google.com/drive/u/1/folders/driveId

¥You can find the driveId and folderID by visiting the shared drive or folder in your browser and copying the last URL component: https://drive.google.com/drive/u/1/folders/driveId.

选项#

¥Options

  • 应用属性:一组任意键值对,仅对请求应用私有。

¥APP Properties: A bundle of arbitrary key-value pairs which are private to the requesting app.

  • 属性:一组任意键值对,对所有应用可见。

¥Properties: A bundle of arbitrary key-value pairs which are visible to all apps.

  • 永久保留版本:选择是否在新版本中设置 keepForever 字段。这仅适用于包含二进制内容的文件。你最多可​​以保留 200 个版本,之后必须删除已固定的版本。

¥Keep Revision Forever: Choose whether to set the keepForever field in the new head revision. This only applies to files with binary content. You can keep a maximum of 200 revisions, after which you must delete the pinned revisions.

  • OCR 语言:ISO 639-1 语言代码,用于帮助 OCR 在导入期间解释内容。

¥OCR Language: An ISO 639-1 language code to help the OCR interpret the content during import.

  • 使用“内容作为可索引文本”:选择是否将上传的内容标记为可索引文本。

¥Use Content As Indexable Text: Choose whether to mark the uploaded content as indexable text.

  • 转换为 Google 文档:选择是否创建 Google 文档而不是默认的 .txt 格式。你必须在 Google API 控制台 中启用 Google Docs API 才能使其正常工作。

¥Convert to Google Document: Choose whether to create a Google Document instead of the default .txt format. You must enable the Google Docs API in the Google API Console for this to work.

请参阅 方法:files.insert | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: files.insert | Google Drive API documentation for more information.

删除文件#

¥Delete a file

使用此操作可从云端硬盘中删除文件。

¥Use this operation to delete a file from a drive.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“删除”。

¥Operation: Select Delete.

  • 文件:选择要删除的文件。

¥File: Choose a file you want to delete.

  • 选择“从列表中选择标题”以从下拉列表中选择标题,选择“通过 URL”以输入文件 URL,或选择“通过 ID”以输入 fileId

    ¥Select From list to choose the title from the dropdown list, By URL to enter the URL of the file, or By ID to enter the fileId.

  • 你可以在可共享的 Google 云端硬盘文件 URL 中找到 fileIdhttps://docs.google.com/document/d/fileId/edit#gid=0。在 Google 云端硬盘中,选择“共享”>“复制链接”以获取可共享文件的 URL。

    ¥You can find the fileId in a shareable Google Drive file URL: https://docs.google.com/document/d/fileId/edit#gid=0. In your Google Drive, select Share > Copy link to get the shareable file URL.

选项#

¥Options

  • 永久删除:选择是否立即删除文件而不是将其移至回收站。

¥Delete Permanently: Choose whether to delete the file now instead of moving it to the trash.

请参阅 方法:files.delete | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: files.delete | Google Drive API documentation for more information.

下载文件#

¥Download a file

使用此操作从驱动器下载文件。

¥Use this operation to download a file from a drive.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“下载”。

¥Operation: Select Download.

  • 文件:选择要下载的文件。

¥File: Choose a file you want to download.

  • 选择“从列表中选择标题”以从下拉列表中选择标题,选择“通过 URL”以输入文件 URL,或选择“通过 ID”以输入 fileId

    ¥Select From list to choose the title from the dropdown list, By URL to enter the URL of the file, or By ID to enter the fileId.

  • 你可以在可共享的 Google 云端硬盘文件 URL 中找到 fileIdhttps://docs.google.com/document/d/fileId/edit#gid=0。在 Google 云端硬盘中,选择“共享”>“复制链接”以获取可共享文件的 URL。

    ¥You can find the fileId in a shareable Google Drive file URL: https://docs.google.com/document/d/fileId/edit#gid=0. In your Google Drive, select Share > Copy link to get the shareable file URL.

选项#

¥Options

  • 将输出文件放入字段:选择用于放置二进制文件内容的字段名称,以便后续节点可以访问该文件。

¥Put Output File in Field: Choose the field name to place the binary file contents to make it available to following nodes.

  • Google File Conversion:请从以下选项中选择下载 Google 文件时要导出的格式:

¥Google File Conversion: Choose the formats to export as when downloading Google Files:

  • Google Docs:选择下载 Google 文档文件时使用的导出格式:支持 HTML、MS Word 文档、Open Office 文档、PDF、富文本 (rtf) 或纯文本 (txt) 格式。

    ¥Google Docs: Choose the export format to use when downloading Google Docs files: HTML, MS Word Document, Open Office Document, PDF, Rich Text (rtf), or Text (txt).

  • Google Drawings:选择下载 Google 绘图文件时使用的导出格式:JPEG、PDF、PNG 或 SVG。

    ¥Google Drawings: Choose the export format to use when downloading Google Drawing files: JPEG, PDF, PNG, or SVG.

  • Google Slides:选择下载 Google 幻灯片文件时使用的导出格式:MS PowerPoint、OpenOffice Presentation 或 PDF。

    ¥Google Slides: Choose the export format to use when downloading Google Slides files: MS PowerPoint, OpenOffice Presentation, or PDF.

  • Google Sheets:选择下载 Google 表格文件时使用的导出格式:CSV、MS Excel、Open Office Sheet 或 PDF。

    ¥Google Sheets: Choose the export format to use when downloading Google Sheets files: CSV, MS Excel, Open Office Sheet, or PDF.

  • 文件名:下载文件的名称。

¥File Name: The name to use for the downloaded file.

请参阅 方法:files.get | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: files.get | Google Drive API documentation for more information.

移动文件#

¥Move a file

使用此操作将文件移动到驱动器中的其他位置。

¥Use this operation to move a file to a different location in a drive.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“移动”。

¥Operation: Select Move.

  • 文件:选择要移动的文件。

¥File: Choose a file you want to move.

  • 选择“从列表中选择标题”以从下拉列表中选择标题,选择“通过 URL”以输入文件 URL,或选择“通过 ID”以输入 fileId

    ¥Select From list to choose the title from the dropdown list, By URL to enter the URL of the file, or By ID to enter the fileId.

  • 你可以在可共享的 Google 云端硬盘文件 URL 中找到 fileIdhttps://docs.google.com/document/d/fileId/edit#gid=0。在 Google 云端硬盘中,选择“共享”>“复制链接”以获取可共享文件的 URL。

    ¥You can find the fileId in a shareable Google Drive file URL: https://docs.google.com/document/d/fileId/edit#gid=0. In your Google Drive, select Share > Copy link to get the shareable file URL.

  • 父驱动器:选择“从列表”从下拉列表中选择驱动器,选择“按 URL”输入驱动器的 URL,或选择“按 ID”输入 driveId

¥Parent Drive: Select From list to choose the drive from the dropdown list, By URL to enter the URL of the drive, or By ID to enter the driveId.

  • 父文件夹:选择“从列表”从下拉列表中选择文件夹,选择“按 URL”输入文件夹的 URL,或选择“按 ID”输入 folderId

¥Parent Folder: Select From list to choose the folder from the dropdown list, By URL to enter the URL of the folder, or By ID to enter the folderId.

你可以通过在浏览器中访问共享云端硬盘或文件夹,并复制 URL 的最后一个部分来找到 driveIdfolderIDhttps://drive.google.com/drive/u/1/folders/driveId

¥You can find the driveId and folderID by visiting the shared drive or folder in your browser and copying the last URL component: https://drive.google.com/drive/u/1/folders/driveId.

请参阅 方法:parents.insert | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: parents.insert | Google Drive API documentation for more information.

共享文件#

¥Share a file

使用此操作向文件添加共享权限。

¥Use this operation to add sharing permissions to a file.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“共享”。

¥Operation: Select Share.

  • 文件:选择要共享的文件。

¥File: Choose a file you want to share.

  • 选择“从列表中选择标题”以从下拉列表中选择标题,选择“通过 URL”以输入文件 URL,或选择“通过 ID”以输入 fileId

    ¥Select From list to choose the title from the dropdown list, By URL to enter the URL of the file, or By ID to enter the fileId.

  • 你可以在可共享的 Google 云端硬盘文件 URL 中找到 fileIdhttps://docs.google.com/document/d/fileId/edit#gid=0。在 Google 云端硬盘中,选择“共享”>“复制链接”以获取可共享文件的 URL。

    ¥You can find the fileId in a shareable Google Drive file URL: https://docs.google.com/document/d/fileId/edit#gid=0. In your Google Drive, select Share > Copy link to get the shareable file URL.

  • 权限:添加到文件的权限:

¥Permissions: The permissions to add to the file:

  • 角色:选择用户可以对文件执行的操作。可以是评论者、文件整理者、组织者、所有者、读者或作者之一。

    ¥Role: Select what users can do with the file. Can be one of Commenter, File Organizer, Organizer, Owner, Reader, Writer.

  • 类型:选择新权限的范围:

    ¥Type: Select the scope of the new permission:

    • 用户:授予特定用户的权限,通过输入其电子邮件地址定义。

    ¥User: Grant permission to a specific user, defined by entering their Email Address.

    • 组:授予特定组的权限,通过输入其电子邮件地址定义。

    ¥Group: Grant permission to a specific group, defined by entering its Email Address.

    • 域:授予整个域的权限,由“域”定义。

    ¥Domain: Grant permission to a complete domain, defined by the Domain.

    • 任何人:授予任何人权限。可以选择启用文件发现功能,使文件可通过搜索找到。

    ¥Anyone: Grant permission to anyone. Can optionally Allow File Discovery to make the file discoverable through search.

选项#

¥Options

  • 邮件内容:要包含在通知电子邮件中的纯文本自定义消息。

¥Email Message: A plain text custom message to include in the notification email.

  • 移动到新的所有者根目录:尝试在共享非共享驱动器中的项目时转移所有权时可用。启用后,将文件移动到新所有者的“我的云端硬盘”根文件夹。

¥Move to New Owners Root: Available when trying to transfer ownership while sharing an item not in a shared drive. When enabled, moves the file to the new owner's My Drive root folder.

  • 发送通知邮件:在与用户或群组共享时是否发送通知邮件。

¥Send Notification Email: Whether to send a notification email when sharing to users or groups.

  • 所有权转移:是否将所有权转移给指定用户并将当前所有者的权限降级为写入权限。

¥Transfer Ownership: Whether to transfer ownership to the specified user and downgrade the current owner to writer permissions.

  • 使用域管理员访问权限:是否以域管理员身份执行操作。

¥Use Domain Admin Access: Whether to perform the action as a domain administrator.

请参阅 REST 资源:files | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the REST Resources: files | Google Drive API documentation for more information.

更新文件#

¥Update a file

使用此操作更新文件。

¥Use this operation to update a file.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“更新”。

¥Operation: Select Update.

  • 待更新文件:选择要更新的文件。

¥File to Update: Choose a file you want to update.

  • 选择“从列表中选择标题”以从下拉列表中选择标题,选择“通过 URL”以输入文件 URL,或选择“通过 ID”以输入 fileId

    ¥Select From list to choose the title from the dropdown list, By URL to enter the URL of the file, or By ID to enter the fileId.

  • 你可以在可共享的 Google 云端硬盘文件 URL 中找到 fileIdhttps://docs.google.com/document/d/fileId/edit#gid=0。在 Google 云端硬盘中,选择“共享”>“复制链接”以获取可共享文件的 URL。

    ¥You can find the fileId in a shareable Google Drive file URL: https://docs.google.com/document/d/fileId/edit#gid=0. In your Google Drive, select Share > Copy link to get the shareable file URL.

  • 更改文件内容:选择是否发送新的二进制数据以替换现有文件内容。如果启用,请填写以下内容:

¥Change File Content: Choose whether to send new binary data to replace the existing file content. If enabled, fill in the following:

  • 输入数据字段名称:包含你要使用的二进制文件数据的输入字段的名称。

    ¥Input Data Field Name: The name of the input field that contains the binary file data you wish to use.

  • 新建更新文件名:如果你想更新文件名,请使用新文件名。

¥New Updated File Name: A new name for the file if you want to update the filename.

选项#

¥Options

  • 应用属性:一组任意键值对,仅对请求应用私有。

¥APP Properties: A bundle of arbitrary key-value pairs which are private to the requesting app.

  • 属性:一组任意键值对,对所有应用可见。

¥Properties: A bundle of arbitrary key-value pairs which are visible to all apps.

  • 永久保留版本:选择是否在新版本中设置 keepForever 字段。这仅适用于包含二进制内容的文件。你最多可​​以保留 200 个版本,之后必须删除已固定的版本。

¥Keep Revision Forever: Choose whether to set the keepForever field in the new head revision. This only applies to files with binary content. You can keep a maximum of 200 revisions, after which you must delete the pinned revisions.

  • OCR 语言:ISO 639-1 语言代码,用于帮助 OCR 在导入期间解释内容。

¥OCR Language: An ISO 639-1 language code to help the OCR interpret the content during import.

  • 使用“内容作为可索引文本”:选择是否将上传的内容标记为可索引文本。

¥Use Content As Indexable Text: Choose whether to mark the uploaded content as indexable text.

  • 移至回收站是否将文件移至回收站。仅限文件所有者。

¥Move to Trash: Whether to move the file to the trash. Only possible for the file owner.

  • 返回字段:返回文件的元数据字段。可以是以下一项或多项:[全部]、已删除、导出链接、有缩略图、图标链接、ID、种类、MIME 类型、名称、权限、共享、空间、已加星标、缩略图链接、已删除、版本或 webViewLink。

¥Return Fields: Return metadata fields about the file. Can be one or more of the following: [All], explicitlyTrashed, exportLinks, hasThumbnail, iconLink, ID, Kind, mimeType, Name, Permissions, Shared, Spaces, Starred, thumbnailLink, Trashed, Version, or webViewLink.

请参阅 方法:files.update | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: files.update | Google Drive API documentation for more information.

上传文件#

¥Upload a file

使用此操作上传文件。

¥Use this operation to upload a file.

请输入以下参数:

¥Enter these parameters:

¥Credential to connect with: Create or select an existing Google Drive credentials.

  • 资源:选择“文件”。

¥Resource: Select File.

  • 操作:选择“上传”。

¥Operation: Select Upload.

  • 输入数据字段名称:包含你要使用的二进制文件数据的输入字段的名称。

¥Input Data Field Name: The name of the input field that contains the binary file data you wish to use.

  • 文件名:新文件的名称。

¥File Name: The name to use for the new file.

  • 父驱动器:选择“从列表”从下拉列表中选择驱动器,选择“按 URL”输入驱动器的 URL,或选择“按 ID”输入 driveId

¥Parent Drive: Select From list to choose the drive from the dropdown list, By URL to enter the URL of the drive, or By ID to enter the driveId.

  • 父文件夹:选择“从列表”从下拉列表中选择文件夹,选择“按 URL”输入文件夹的 URL,或选择“按 ID”输入 folderId

¥Parent Folder: Select From list to choose the folder from the dropdown list, By URL to enter the URL of the folder, or By ID to enter the folderId.

你可以通过在浏览器中访问共享云端硬盘或文件夹,并复制 URL 的最后一个部分来找到 driveIdfolderIDhttps://drive.google.com/drive/u/1/folders/driveId

¥You can find the driveId and folderID by visiting the shared drive or folder in your browser and copying the last URL component: https://drive.google.com/drive/u/1/folders/driveId.

选项#

¥Options

  • 应用属性:一组任意键值对,仅对请求应用私有。

¥APP Properties: A bundle of arbitrary key-value pairs which are private to the requesting app.

  • 属性:一组任意键值对,对所有应用可见。

¥Properties: A bundle of arbitrary key-value pairs which are visible to all apps.

  • 永久保留版本:选择是否在新版本中设置 keepForever 字段。这仅适用于包含二进制内容的文件。你最多可​​以保留 200 个版本,之后必须删除已固定的版本。

¥Keep Revision Forever: Choose whether to set the keepForever field in the new head revision. This only applies to files with binary content. You can keep a maximum of 200 revisions, after which you must delete the pinned revisions.

  • OCR 语言:ISO 639-1 语言代码,用于帮助 OCR 在导入期间解释内容。

¥OCR Language: An ISO 639-1 language code to help the OCR interpret the content during import.

  • 使用“内容作为可索引文本”:选择是否将上传的内容标记为可索引文本。

¥Use Content As Indexable Text: Choose whether to mark the uploaded content as indexable text.

  • 简化输出:选择是否返回简化版响应,而不是包含所有字段。

¥Simplify Output: Choose whether to return a simplified version of the response instead of including all fields.

请参阅 方法:files.insert | Google 云端硬盘 API 文档了解更多信息。

¥Refer to the Method: files.insert | Google Drive API documentation for more information.