Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Google Drive sắp xếp các tệp thành bộ sưu tập, mô tả các tệp theo loại và cung cấp các thuộc tính cụ thể cho từng tệp để tạo điều kiện thuận lợi cho việc thao tác với tệp.
API Google Drive biểu thị các tệp được lưu trữ trên Drive dưới dạng tài nguyên files.
Quyền sở hữu
Drive sắp xếp các tệp dựa trên mối quan hệ của người dùng với nội dung và vị trí lưu trữ của nội dung đó. Bộ sưu tập được chỉ định trong siêu dữ liệu của tệp để cho biết nhóm tệp mà tệp được lưu trữ trong Drive. Điểm khác biệt chính giữa các bộ sưu tập trong Drive của tôi và bộ nhớ dùng chung là quyền sở hữu tệp. Một người dùng duy nhất là chủ sở hữu của các tệp trong Drive của tôi, trong khi một nhóm hoặc tổ chức sở hữu các tệp trong bộ nhớ dùng chung.
Drive của tôi
Mỗi người dùng đều có một thư mục "gốc" có tên là "Ổ của tôi" hoạt động như hệ thống phân cấp chính của họ và bao gồm mọi thứ bắt nguồn từ thư mục gốc này. Người dùng này là chủ sở hữu chính của thư mục này.
Bộ nhớ dùng chung
Bộ nhớ dùng chung là một cấu trúc tổ chức trong Drive, tồn tại song song với Drive của tôi. Bạn có thể sắp xếp một tệp riêng lẻ trong bộ nhớ dùng chung hoặc Drive của tôi, nhưng không thể sắp xếp trong cả hai. Tuy nhiên, bạn có thể dùng
lối tắt trên Drive để trỏ đến tệp hoặc thư mục từ bộ nhớ dùng chung đến Drive của tôi hoặc ngược lại.
Loại tệp
Drive mô tả các tệp theo loại. Danh sách này cho thấy tất cả các loại tệp có sẵn:
Blob
Một tệp chứa văn bản hoặc nội dung nhị phân, chẳng hạn như hình ảnh, video và tệp PDF.
Thư mục
Một vùng chứa mà bạn có thể dùng để sắp xếp các loại tệp khác trên Drive. Thư mục là những tệp chỉ chứa siêu dữ liệu và có loại MIME là application/vnd.google-apps.folder. Để biết thêm thông tin, hãy xem phần Tạo và điền thông tin vào thư mục.
Lưu ý: Một tệp duy nhất được lưu trữ trên Drive của tôi có thể nằm trong nhiều thư mục. Một tệp duy nhất được lưu trữ trên bộ nhớ dùng chung chỉ có thể có một thư mục mẹ.
Tài liệu trên Google Workspace
Một tệp do ứng dụng Google Workspace tạo, chẳng hạn như Google Tài liệu, Trang tính hoặc Trang trình bày. Định dạng loại MIME là application/vnd.google-apps.*app*, trong đó app là tên ứng dụng (chẳng hạn như application/vnd.google-apps.spreadsheet cho tệp Trang tính). Để xem danh sách các loại MIME dành riêng cho Drive và Google Workspace, hãy xem bài viết Các loại MIME được Google Workspace và Google Drive hỗ trợ.
Phím tắt
Một tệp chỉ chứa siêu dữ liệu và trỏ đến một tệp khác trên Drive. Loại MIME của tệp lối tắt là application/vnd.google-apps.shortcut. Để biết thêm thông tin, hãy xem bài viết Tạo lối tắt đến một tệp trên Drive.
Lối tắt của bên thứ ba
Một tệp chỉ chứa siêu dữ liệu, liên kết đến nội dung được lưu trữ trên hệ thống lưu trữ của bên thứ ba. Loại MIME của tệp lối tắt bên thứ ba là application/vnd.google-apps.drive-sdk. Để biết thêm thông tin, hãy xem phần Tạo tệp lối tắt đến nội dung do ứng dụng của bạn lưu trữ.
Đặc điểm của tệp
Danh sách này cho thấy một số đặc điểm của tệp trên Drive:
Nội dung nhị phân hoặc văn bản của tệp. Một số ví dụ về nội dung bạn có thể lưu trữ trong Drive là hình ảnh, video, văn bản và tệp PDF.
Mã tệp
Mã nhận dạng duy nhất, không công khai cho từng tệp. Mã tệp ổn định trong suốt thời gian tồn tại của tệp, ngay cả khi tên tệp thay đổi. Biểu thức tìm kiếm được dùng để tìm tệp theo tên, loại, nội dung, vùng chứa mẹ, chủ sở hữu hoặc siêu dữ liệu khác.
Siêu dữ liệu
Dữ liệu mô tả nội dung của tệp. Dữ liệu này bao gồm tên, loại, thời gian tạo và sửa đổi. Một số trường siêu dữ liệu, chẳng hạn như name, không phụ thuộc vào người dùng và xuất hiện giống nhau đối với mỗi người dùng. Các trường khác, chẳng hạn như capabilities và viewedByMeDate chứa các giá trị dành riêng cho người dùng. Các loại tệp, chẳng hạn như hình ảnh và video, chứa siêu dữ liệu bổ sung được trích xuất từ EXIF và siêu dữ liệu được nhúng khác. Để biết thêm thông tin, hãy xem bài viết Quản lý siêu dữ liệu của tệp.
Quyền
Quyền truy cập được cấp cho người dùng, nhóm, miền hoặc mọi người trên thế giới để truy cập vào một tệp hoặc hệ thống phân cấp thư mục. Người dùng kiểm soát những người có thể truy cập vào một tệp bằng danh sách kiểm soát quyền truy cập (ACL). Đây là danh sách các quyền đối với tệp. Để biết thêm thông tin, hãy xem bài viết Chia sẻ tệp, thư mục và ổ đĩa.
Nhật ký sửa đổi
Bản ghi chỉ ghi lại những thay đổi đối với nội dung tệp chứ không ghi lại những thay đổi đối với siêu dữ liệu tệp. Để biết thêm thông tin chi tiết về các bản sửa đổi, hãy xem phần Tổng quan về các thay đổi và bản sửa đổi.
Hình thu nhỏ
Hình ảnh minh hoạ một tệp. Drive tự động tạo hình thu nhỏ cho nhiều loại tệp phổ biến. Đối với lối tắt và các loại tệp khác mà Drive không thể hiển thị, bạn có thể cung cấp hình thu nhỏ. Để biết thêm thông tin, hãy xem bài viết Tải hình thu nhỏ lên.
Sắp xếp tệp
Drive API sắp xếp các tệp thành các vị trí lưu trữ, được gọi là spaces và các bộ sưu tập, được gọi là corpora.
Không gian
Các vị trí lưu trữ cụ thể được tách biệt với nhau. Tất cả nội dung trong Drive đều được lưu trữ trong một trong hai không gian được xác định sau đây: drive và appDataFolder.
drive: Bao gồm tất cả các tệp mà người dùng có thể thấy được tạo trong Drive. Tệp PDF, tài liệu, Google Tài liệu, lối tắt và nội dung khác mà người dùng tải lên nằm trong không gian drive.
appDataFolder: Bao gồm dữ liệu ứng dụng cho mỗi người dùng. Các ứng dụng thường lưu trữ tệp cấu hình và dữ liệu khác mà người dùng không được phép truy cập trực tiếp.
Không thể di chuyển tệp giữa các spaces.
Corpora
Tập hợp các tệp được dùng để thu hẹp phạm vi tìm kiếm tệp và thư mục. Các kho ngữ liệu cho Drive là: user, domain, drive và allDrives.
user: Bao gồm tất cả các tệp do người dùng tạo và mở trong "Drive của tôi", cũng như những tệp được chia sẻ trực tiếp với người dùng trong mục "Được chia sẻ với tôi".
drive: Bao gồm tất cả các tệp có trong một ổ đĩa dùng chung duy nhất, như được chỉ ra bởi driveId.
domain: Bao gồm tất cả các tệp có thể tìm kiếm được chia sẻ với miền của người dùng.
allDrives: Bao gồm tất cả tệp trong bộ nhớ dùng chung mà người dùng là thành viên, cũng như tất cả tệp trong thư mục "Drive của tôi" và "Được chia sẻ với tôi".
Hãy thận trọng khi sử dụng allDrives vì nó có phạm vi rộng và có thể ảnh hưởng đến hiệu suất. Khi có thể, hãy dùng user hoặc drive thay vì allDrives để tăng hiệu quả.
Các tệp có thể di chuyển tự do giữa các corpora khi quyền và quyền sở hữu thay đổi.
Chủ đề có liên quan
Sau đây là một số bước tiếp theo bạn có thể thực hiện:
[null,null,["Cập nhật lần gần đây nhất: 2025-08-04 UTC."],[],[],null,["# Files and folders overview\n\nGoogle Drive organizes files in collections, describes files by types, and\nprovides specific attributes for each file to facilitate file manipulation.\n\nThe Google Drive API represents files stored on Drive as a\n[`files`](/workspace/drive/api/reference/rest/v3/files) resource.\n| **Note:** Folders are treated as a type of file. For more details about folders, see [File types](#types).\n\nOwnership\n---------\n\nDrive organizes files based on the user's relationship with the\ncontent and its storage location. *Collections* are specified as part of the\nfile's metadata to show which group of files the file is stored with inside\nDrive. The main difference between My Drive and\nshared drive collections is file ownership. A single user is the owner of files\nin their My Drive, whereas a group or organization owns files in\na shared drive.\n\n*My Drive*\n: Each user has a \"root\" folder called \"My\n Drive\" that functions as their primary hierarchy, and\n consists of everything that descends from this root folder. The user is the\n primary owner of this folder.\n\n*Shared drives*\n: A [shared drive](/workspace/drive/api/guides/about-shareddrives) is an\n organizational structure within Drive that lives parallel to\n My Drive. You can organize an individual file within a shared\n drive or My Drive, but not both. However, [Drive shortcuts](/workspace/drive/api/guides/shortcuts) can be used to\n point to files or folders from shared drives to My Drive, or\n the other way around.\n\nFile types\n----------\n\nDrive describes files by types. This list shows all available\nfile types:\n\n*Blob*\n: A file that contains text or binary content such as images, videos, and\n PDFs.\n\n*Folder*\n\n: A container you can use to organize other types of files on\n Drive. Folders are files that only contain metadata, and have\n the MIME type `application/vnd.google-apps.folder`. For more information,\n see [Create and populate folders](/workspace/drive/api/guides/folder).\n\n **Note:** A single file stored on My Drive can be in multiple\n folders. A single file stored on a [shared\n drive](/workspace/drive/api/guides/about-shareddrives) can only have one parent folder.\n\n*Google Workspace document*\n\n: A file that a Google Workspace application\n creates, such as Google Docs, Sheets, or\n Slides. The MIME type format is\n `application/vnd.google-apps.*app*` where *app* is the application name\n (such as `application/vnd.google-apps.spreadsheet` for a\n Sheets file). For a list of Drive and\n Google Workspace-specific MIME types, see [Google Workspace and\n Google Drive supported MIME types](/workspace/drive/api/guides/mime-types).\n\n*Shortcut*\n\n: A metadata-only file that points to another file on Drive. The\n shortcut file MIME type is `application/vnd.google-apps.shortcut`. For more\n information, see [Create a shortcut to a Drive\n file](/workspace/drive/api/guides/shortcuts).\n\n*Third-party shortcut*\n\n: A metadata-only file that links to content stored on a third-party storage\n system. The third-party shortcut file MIME type is\n `application/vnd.google-apps.drive-sdk`. For more information, see [Create a\n shortcut file to content stored by your\n app](/workspace/drive/api/guides/third-party-shortcuts).\n\n| **Note:** You cannot upload or download folders, Google Workspace documents, shortcuts, and third-party shortcuts to or from Drive. However, if they use compatible formats you can upload or export Google Workspace documents. For example, you can create a Docs document when you import a PDF. Similarly, you can export a Google Slides presentation as a Microsoft PowerPoint file.\n\nFile characteristics\n--------------------\n\nThis list shows some characteristics of a Drive file:\n\n*Access proposal*\n: A proposal from a requester to an approver to grant a recipient access to a\n Drive item. For more information, see [List and resolve\n pending access\n proposals](/workspace/drive/api/guides/manage-sharing#access-proposals).\n\n*Content*\n: The binary or text body of the file. Some content examples you can store in\n Drive are images, videos, text, and PDFs.\n\n*File ID*\n: A unique, opaque ID for each file. File IDs are stable throughout the life of\n the file, even if the file name changes. [Search\n expressions](/workspace/drive/api/guides/search-files) are used to locate files by name,\n type, content, parent container, owner, or other metadata.\n\n*Metadata*\n: Data describing the contents of the file. This data includes the name, type,\n creation, and modification times. Some metadata fields, such as the `name`,\n are user-agnostic and appear the same for each user. Other fields, such as\n `capabilities` and `viewedByMeDate` contain user-specific values. File\n types, such as images and videos, contain additional metadata extracted from\n EXIF and other embedded metadata. For more information, see [Manage file\n metadata](/workspace/drive/api/guides/file).\n\n*Permission*\n: An access grant for a user, group, domain, or the world to access a file or a\n folder hierarchy. Users control who can access a file with the access\n control list (ACL), which is a list of permissions for the file. For more\n information, see [Share files, folders and\n drives](/workspace/drive/api/guides/manage-sharing).\n\n*Revision history*\n: The record of changes to the file content only, not the file metadata. For\n more details about revisions, see [Changes and revisions overview](/workspace/drive/api/guides/change-overview).\n\n*Thumbnail*\n: A graphical representation of a file. Drive automatically\n generates thumbnails for many common file types. For shortcuts and other\n file types that Drive can't render, you can provide a\n thumbnail image. For more information, see [Upload thumbnails](/workspace/drive/api/guides/file#upload-thumbnails).\n\nFile organization\n-----------------\n\nThe Drive API organizes files into storage locations, called `spaces`,\nand collections, called `corpora`.\n\n*Spaces*\n\n: Specific storage locations that are isolated from each other. All content in\n Drive is stored in one of these two defined spaces: `drive`\n and `appDataFolder`.\n\n - `drive`: Includes all user-visible files created in\n Drive. PDFs, documents, Google Docs, shortcuts, and\n other content the user uploads is located in the `drive` space.\n\n - `appDataFolder`: Includes per-user application data. Applications\n typically store configuration files and other data not intended to be\n directly accessible by users.\n\n Files cannot move between `spaces`.\n\n*Corpora*\n\n: Collections of files used to narrow the scope of file and folder searches. The\n corpora for Drive are: `user`, `domain`, `drive`, and\n `allDrives`.\n\n - `user`: Includes all files created by and opened by the user in \"My\n Drive\", and those shared directly with the user in\n \"Shared with me.\"\n\n - `drive`: Includes all files contained in a single shared drive, as\n indicated by the `driveId`.\n\n - `domain`: Includes all searchable files shared with the user's domain.\n\n - `allDrives`: Includes all files in shared drives where the user is a\n member, and all files in \"My Drive\" and \"Shared with me.\"\n Use the `allDrives` corpora with caution as it has a broad scope and can\n affect performance. When possible, use `user` or `drive` instead of\n `allDrives` for efficiency.\n\n Files can move freely between `corpora` as permissions and ownership change.\n\nRelated topics\n--------------\n\nHere are a few next steps you might take:\n\n- Learn how to [Create and manage files](/workspace/drive/api/guides/create-file).\n- Learn how to [Create and populate folders](/workspace/drive/api/guides/folder).\n- Learn how to [Upload file data](/workspace/drive/api/guides/manage-uploads).\n- Learn how to [Download and export files](/workspace/drive/api/guides/manage-downloads).\n- Learn how to [Store application-specific data](/workspace/drive/api/guides/appdata).\n- Learn how to [Display the Google Picker](/workspace/drive/api/guides/picker) on a page."]]