- Docs
- Guides
- Advanced
- Storage destinations
- Upload to DigitalOcean Spaces
Upload to DigitalOcean Spaces
Send every rendered image or PDF to a DigitalOcean Space you control.
HTML/CSS to Image connects to DigitalOcean Spaces through its S3-compatible API. HCTI derives the service endpoint from the Space’s region and authenticates with a Spaces access key and secret.
Before you begin
Section titled “Before you begin”You need:
- An existing DigitalOcean Space.
- The Space’s region, such as
nyc3,sfo3, orams3. - An optional key prefix, such as
hcti-renders.
The region appears at the beginning of the Spaces endpoint: https://<region>.digitaloceanspaces.com.
Create a Spaces access key
Section titled “Create a Spaces access key”In the DigitalOcean control panel, open the Spaces Keys section and generate a new key.
- Give the key a recognizable name.
- Restrict it to the destination Space when possible.
- Grant object read, write, and delete access for the complete HCTI workflow.
- Copy the access key and secret. Save the secret when it is shown.
Write access is required for images and connection tests. Read access lets HCTI reload the original for a later resize, crop, or format conversion when Disable HCTI Storage is selected. Delete access only cleans up connection-test objects; HCTI does not delete your rendered images.
If you configure both a scoped key and an HCTI key prefix, make sure the key’s permitted object path includes that same prefix.
Add DigitalOcean Spaces to HCTI
Section titled “Add DigitalOcean Spaces to HCTI”Open the Storage Destinations dashboard, click Add storage destination, and enter:
| HCTI field | DigitalOcean value |
|---|---|
| Provider | DigitalOcean Spaces |
| Bucket | Existing Space name |
| Key prefix | Optional folder-like prefix, without leading or trailing slashes |
| Region | Space region, such as nyc3 |
| Access key ID | Spaces access key |
| Secret access key | Spaces secret key |
Click Test connection, then enable and save the destination after the test succeeds. Copy the destination id for your API requests.
The test writes a small object under <key-prefix>/.hcti/connection-tests/. Cleanup is best-effort, so missing delete access does not make a successful write test fail.
Upload an HCTI image to Spaces
Section titled “Upload an HCTI image to Spaces”Pass the destination ID as storage_destination_id when you create an image:
curl -X POST https://hcti.io/v1/image \ -u 'user-id:api-key' \ -H 'Content-Type: application/json' \ -d '{ "url": "https://example.com", "storage_destination_id": "your-storage-destination-id" }'Rendering is lazy. With normal HCTI storage enabled, request the returned image URL to render the image and upload the Spaces copy. With Disable HCTI Storage selected, send an authenticated PUT request to the returned /v1/store/... URL.
The base object is stored as <key-prefix>/<image-id>.png, or .pdf when the request uses pdf_options. HCTI does not change the Space’s file permissions or CDN configuration.
Troubleshooting DigitalOcean Spaces uploads
Section titled “Troubleshooting DigitalOcean Spaces uploads”- The connection test cannot find the Space — Confirm the Space name and the region at the beginning of its endpoint.
- Authentication fails — Use a Spaces key pair, not a DigitalOcean personal access token.
- A scoped key returns Access Denied — Confirm that it grants write access to the Space and to the configured prefix.
- A later transformation fails with HCTI Storage disabled — Add object read access.
- Connection-test objects remain — Add object delete access for
.hcti/connection-tests/.
DigitalOcean documents the Spaces S3-compatible API, endpoints, and permission levels.
Automate destination setup
Section titled “Automate destination setup”You can also automate configuration through the Storage destinations API or MCP tools.
Need help?
Talk to a human. Email support@htmlcsstoimage.com and we’ll help you get started.