Upload File
Upload a file to 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 |
| Header |
Required |
Description |
Content-Type |
no |
Initial MIME type. The stored value may be detected from content. |
Request
1curl -X PUT "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 -H "Content-Type: image/png" \
4 --data-binary @logo.png
Response
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 |
| 500 |
Persistence or filesystem error |
Comments