Download File
Download a file from a bucket. The file path is specified after /files/.
Authentication
Requires X-Glue-Authentication.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
bucket_id |
string | The bucket ID |
* |
string | File path |
Query Parameters
| Parameter | Description |
|---|---|
metadata |
If present, returns the file object as JSON instead of the file body. |
Request
1curl "https://api.hola.cloud/v1/buckets/bucket-550e8400-e29b-41d4-a716-446655440000/files/images/logo.png" \
2 -H 'X-Glue-Authentication: {"user":{"id":"user-123"}}' \
3 -o logo.png
Response
The response body is the raw file content. Content-Type is set from the stored mime_type.
Metadata Response
1curl "https://api.hola.cloud/v1/buckets/bucket-550e8400-e29b-41d4-a716-446655440000/files/images/logo.png?metadata" \
2 -H 'X-Glue-Authentication: {"user":{"id":"user-123"}}'
1{
2 "id": "file-9f0b7b3c-1d2e-4a5f-8b9c-0123456789ab",
3 "uuid": "9f0b7b3c-1d2e-4a5f-8b9c-0123456789ab",
4 "created_timestamp": 1782045660000000000,
5 "updated_timestamp": 1782045660000000000,
6 "owners": ["user-123"],
7 "status": "available",
8 "size": 24576,
9 "name": "images/logo.png",
10 "bucket": "bucket-550e8400-e29b-41d4-a716-446655440000",
11 "hash_md5": "example-md5",
12 "hash_sha256": "example-sha256",
13 "mime_type": "image/png"
14}
Error Codes
| Status | Description |
|---|---|
| 401 | Missing or invalid X-Glue-Authentication |
| 404 | File not found |
| 500 | Persistence or filesystem error |
Comments