Hubfly spaceDocs
Console

Storage quick start

This path stores one file in a project bucket and reads it back. You need a Hubfly space account with permission to create a project, plus an S3-compatible client or SDK.

Before you begin

Create a new project and select Storage as its platform. Choose the Storage region where the data should live. Open the project’s Storage workspace and note the displayed S3 endpoint and signing region. They are used by your application; the Dashboard API address is different.

Create and upload

  1. Create a bucket. Choose a name such as project-assets. Buckets contain objects; an object key such as reports/hello.txt can include slashes without creating directories.
  2. Create an access key. Give it a name and readwrite permission. Choose a bucket scope when only one bucket is needed. Copy the access key ID and secret from the creation result; the secret is shown once.
  3. Configure your client. Set the Hubfly space S3 endpoint, the displayed signing region, and the new key pair. Use HTTPS and AWS Signature Version 4. Enable path-style addressing for SDKs that otherwise construct AWS bucket hostnames.
  4. Upload a file. PUT reports/hello.txt into the bucket through the S3 client. Set a useful Content-Type, such as text/plain.
AWS CLI example
aws --endpoint-url "$HUBFLY_STORAGE_ENDPOINT" s3api put-object \
  --bucket project-assets \
  --key reports/hello.txt \
  --body ./hello.txt \
  --content-type text/plain

Set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION to the values from the Storage workspace before running the command. Use the exact endpoint shown for your project.

Uploading from a browser?

Have your server request a short-lived object upload session with its Hubfly space API token, then give the browser only the returned upload_url. The browser PUTs the file there before expires_at (one hour), sending no headers other than Content-Type; that upload URL accepts cross-origin requests. Do not send browser uploads straight to the S3 endpoint, even with a presigned URL: it rejects the browser's CORS preflight. If the upload URL does not fit your app, upload through your own backend.

Verify the object

List the bucket or open the object browser in Dashboard. Download the key and compare its bytes with your original file. The S3 API also supports HEAD when you only need metadata.

AWS CLI example
aws --endpoint-url "$HUBFLY_STORAGE_ENDPOINT" s3api get-object \
  --bucket project-assets \
  --key reports/hello.txt \
  ./downloaded-hello.txt

Do it with the CLI

The hubfly CLI covers the same path. Uploads and downloads use temporary URLs issued for your account, so you only need an S3 key for your application:

bash
hubfly storage create media                      # choose the region, confirm, wait until ready
hubfly storage buckets create project-assets --project media
hubfly storage put ./hello.txt project-assets/reports/ --project media
hubfly storage get project-assets/reports/hello.txt ./downloaded-hello.txt --project media
hubfly storage keys create my-app --bucket project-assets --format dotenv --project media   # secret printed once

See the hubfly storage reference for every command.

What next

  • Read buckets and objects for listing, versions, multipart uploads, and deletion.
  • Register the object as a managed asset if you need delivery controls or image variants.
  • See the S3 reference for exact supported operations and an SDK configuration example.
Something unclear or out of date? Emailsupport@hubfly.spaceBack to top