This page shows you how to download objects from your Cloud Storage buckets into memory by using Cloud Storage client libraries. Downloading into memory is useful when you want to avoid unnecessary writes to persistent storage. For instructions on how to download objects directly to persistent memory, see Downloading objects to persistent memory. For a conceptual overview of how downloads work in Cloud Storage, see Uploads and downloads.
Required roles
In order to get the required permissions for downloading objects into memory,
ask your administrator to grant you the Storage Object Viewer
(roles/storage.objectViewer
) role on the bucket.
This role contains the permission required to download objects. To see the exact permission that's required, expand the Required permissions section:
Required permissions
storage.objects.get
You might also be able to get this permission with other predefined roles or custom roles.
For instructions on granting roles on buckets, see Use IAM with buckets.
Download an object into memory
Client libraries
For more information, see the
Cloud Storage C++ API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage C# API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage Go API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage Java API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage Node.js API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage PHP API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage Python API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
For more information, see the
Cloud Storage Ruby API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for client libraries.
C++
C#
Go
Java
Node.js
PHP
Python
Ruby
What's next
- Transfer data from cloud providers or other online sources, such as URL lists.