How to Set File Listing Permissions for Spaces

Spaces Object Storage is an S3-compatible object storage service. Spaces buckets let you store and serve large amounts of data, and the built-in CDN minimizes page load times and improves performance.


A Spaces bucket’s file listing is a list of the bucket’s contents in XML. It displays the names (called keys) of every file in the bucket as well as other file information, like the file sizes and last modified dates.

Owners of a bucket set the visibility permissions of this file listing, which can be:

  • Public, meaning anyone on the internet can view the listing by visiting the base URL of the bucket, even if the contents of individual files are set to Private.
  • Private, meaning only users who connect to the bucket using access keys can list the contents.

The permission to list the contents of a DigitalOcean Spaces bucket is Private by default.

You can set the visibility of the list of contents when creating a bucket. On existing buckets, you can view and edit it on the bucket’s Settings tab, in the File Listing section.

The Spaces settings tab

The Spaces file listing looks similar to this:

 <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Name>permissions</Name>
   <Prefix/>
   <Marker/>
   <MaxKeys>1000</MaxKeys>
   <IsTruncated>false</IsTruncated>
   <Contents>
     <Key>example-file.txt</Key>
     <LastModified>2017-09-17T19:20:21.360Z</LastModified>
     <ETag>"39365ac292b6471ef008d1099bf99963"</ETag>
     <Size>42</Size>
     <StorageClass>STANDARD</StorageClass>
     <Owner>
       <ID>2900818</ID>
       <DisplayName>2900818</DisplayName>
     </Owner>
   </Contents>
   <Contents>
     <Key>image.png</Key>
     <LastModified>2017-09-17T23:19:53.222Z</LastModified>
     <ETag>"00d3c043c2e54e99712d6e526932bb76"</ETag>
     <Size>95607</Size>
     <StorageClass>STANDARD</StorageClass>
     <Owner>
       <ID>2900818</ID>
       <DisplayName>2900818</DisplayName>
     </Owner>
   </Contents>
 </ListBucketResult>