Upload objects from memory

This page shows you how to upload objects from memory to your Cloud Storage bucket by using client libraries. Uploading from memory is useful for when you want to avoid unnecessary writes from memory to your local file system.

An uploaded object consists of the data you want to store along with any associated metadata. For a conceptual overview, including how to choose the optimal upload method based on your file size, see Uploads and downloads.

Required roles

To get the permissions that you need to upload objects from memory to a bucket, ask your administrator to grant you the Storage Object User (roles/storage.objectUser) IAM role on the bucket. This predefined role contains the permissions required to upload an object to a bucket. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

  • storage.objects.create
  • storage.objects.delete
    • This permission is only required for uploads that overwrite an existing object.

You can also get these permissions with custom roles.

For information about granting roles on buckets, see Use IAM with buckets.

Upload an object from memory

Client libraries

What's next