- Container Quotas
- TempURL File Name Overrides
- Bulk Operations (Delete & Auto-Expand Archive)
- Static Large Object support
Now in Control Panel:
- Multiple File Upload
- Editing Headers
Features in the control panel are great, but I’d rather get my hands dirty with the API. Let’s take a look at the new API features one by one.
You can now set quotas on your Cloud Files containers. The X-Container-Meta-Quota-Bytes header is used to limit the maximum size of a container, in bytes. The X-Container-Meta-Quota-Count header is used to set the maximum object count of the container. To set either one of these, you can use a PUT with
1 2 3 4
You can use either header to set the quota you prefer. When the user tries to exceed the quota, they get a “Upload exceeds quota” message.
TempURL File Name Overrides
With the new TempURL File Name Override feature, you can specify a “filename” query parameter to override a TempURL’s Content-Disposition header in order to instruct their browser to save a TempURL file with a specific name. This is done by appending
&filename=my_file_name to the end of a TempURL. Basically, if you have a file called 1234567890abcdefgh and you want your users to save it as file.pdf, you can use the following URL:
Bulk Operations (Delete & Auto-Expand Archive)
Two new bulk operations are now available: delete and archive auto extractions. You can upload and auto-extract tar archives upon PUT request to your Cloud Files account. This is done using the query parameter
?extract-archive=format specifying the format of archive file. Accepted formats are tar, tar.gz, and tar.bz2. Root directories in the archive will be converted to containers if uploaded at the account level, or mapped to pseudo-directory names if uploaded into existing containers.
Upload and Extract
Assuming you have a tar archive called
archive.tar, you can upload and extract it as a container with this command:
1 2 3 4
If you want to upload the contents of
archive.tar to an existing container, you can use this command:
1 2 3 4
To delete objects in bulk, create a list of files you wish to delete, then pass the list in a DELETE request:
1 2 3
1 2 3
Static Large Object support
Static Large Object Support (SLO) is very similar to Dynamic Large Object (DLO) support in that it allows the user to upload many objects concurrently and afterwards download them as a single object. It is different than DLO in that it does not rely on eventually consistent container listings to do so. Instead, a user defined manifest of the object segments is used to help guarantee that every segment in the manifest exists and has matched the specifications. If everything does match, the user will receive a 2xx response and the SLO object is ready for downloading. This can improve consistency when uploading multiple segments concurrently and subsequently downloading the resulting large object a short time after. Documentation on how to upload multiple objects and a manifest is available here.
We hope you enjoy these new features!