Download files or list directory contents.
When the path points to a directory:
curl -X GET "https://storage.cludz.net/storage/{uuid}/documents/" \
-H "Token: YOUR_STORAGE_TOKEN"
{
"statusCode": 200,
"message": "Directory contents",
"data": [
{
"name": "report.pdf",
"size": 1048576,
"isDirectory": false,
"checksum": "abc123...",
"created_at": "2025-01-01T00:00:00.000Z",
"modified_at": "2025-01-01T00:00:00.000Z"
},
{
"name": "images",
"size": 0,
"isDirectory": true,
"checksum": "",
"created_at": "2025-01-01T00:00:00.000Z",
"modified_at": "2025-01-01T00:00:00.000Z",
"sharingStatus": "public"
}
]
}
| Field | Type | Description |
|---|---|---|
name | string | File or folder name |
size | number | Size in bytes |
isDirectory | boolean | True if folder |
checksum | string | SHA-256 hash (files only) |
created_at | string | Creation timestamp |
modified_at | string | Last modified timestamp |
sharingStatus | string | "public", "shared", or null |
When the path points to a file:
curl -X GET "https://storage.cludz.net/storage/{uuid}/documents/report.pdf" \
-H "Token: YOUR_STORAGE_TOKEN" \
-o report.pdf
The response includes appropriate headers:
| Header | Description |
|---|---|
Content-Type | MIME type of the file |
Content-Disposition | inline or attachment |
Content-Length | File size in bytes |
Cache-Control | Caching policy |
Accept-Ranges | bytes (range support) |
For streaming large files, use the Range header:
curl -X GET "https://storage.cludz.net/storage/{uuid}/videos/movie.mp4" \
-H "Token: YOUR_STORAGE_TOKEN" \
-H "Range: bytes=0-1048575"
Content-Range: bytes 0-1048575/10485760
Content-Length: 1048576
Get file information as JSON by adding ?detail=true:
curl -X GET "https://storage.cludz.net/storage/{uuid}/documents/report.pdf?detail=true" \
-H "Token: YOUR_STORAGE_TOKEN"
{
"statusCode": 200,
"message": "File info",
"data": {
"isDirectory": false,
"name": "report.pdf",
"path": "/documents/report.pdf",
"size": 1048576,
"hash": "abc123...",
"mimeType": "application/pdf",
"createdAt": "2025-01-01T00:00:00.000Z",
"modifiedAt": "2025-01-01T00:00:00.000Z"
}
}
Check file existence and hash before uploading:
curl -I "https://storage.cludz.net/storage/{uuid}/documents/report.pdf" \
-H "Token: YOUR_STORAGE_TOKEN"
| Header | Description |
|---|---|
X-Is-Directory | "true" or "false" |
X-File-Name | File name |
X-File-Path | Full path |
X-File-Size | Size in bytes |
X-File-Hash | SHA-256 hash |
X-File-Mime | MIME type |
| Status | Message |
|---|---|
403 | No read permission |
404 | Path not found |
404 | Storage not found |
const response = await fetch('https://storage.cludz.net/storage/{uuid}/documents/', {
headers: { 'Token': 'YOUR_STORAGE_TOKEN' }
});
const { data: files } = await response.json();
const response = await fetch('https://storage.cludz.net/storage/{uuid}/docs/report.pdf', {
headers: { 'Token': 'YOUR_STORAGE_TOKEN' }
});
const blob = await response.blob();
const response = await fetch('https://storage.cludz.net/storage/{uuid}/docs/file.pdf', {
method: 'HEAD',
headers: { 'Token': 'YOUR_STORAGE_TOKEN' }
});
const existingHash = response.headers.get('X-File-Hash');