Download file content
Returns the content of a file or directory specified by $FILE_ID.
If $FILE_ID is a regular file, returns its binary content. Partial content download is also supported using Range header.
If $FILE_ID is a directory, returns a TAR archive with its contents. Any nested files or subdirectories to which the client does not have access (e.g. due to insufficient POSIX permissions or ACLs) are omitted in the resulting archive. Request for directory download results in a redirection URL (in Location header) that contains the ID of a temporary download session. The URL can be used to download the tarball, with support for resuming interrupted downloads using the Range header (where the range start is the number of already downloaded bytes and the range end is omitted).
Example cURL requests
Download entire file content
curl -H "X-Auth-Token: $TOKEN" \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$FILE_ID/content"
abcdefghijklmno
Download only part of the file content
curl -H "X-Auth-Token: $TOKEN" \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$FILE_ID/content" \
-H "Range: bytes=5-8"
fghi
Download a directory as tar archive
curl -sD - -H "X-Auth-Token: $TOKEN" \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$DIR_ID/content" | grep location
location: https://$PROVIDER_HOST/download/$DOWNLOAD_ID
curl https://$PROVIDER_HOST/download/$DOWNLOAD_ID > directory.tar
Download a directory as tar archive in a single request
curl -L -H "X-Auth-Token: $TOKEN" \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$DIR_ID/content"
Resume download of a directory (previous download failed after 12345678 bytes)
curl -H "Range: bytes=12345678-" https://$PROVIDER_HOST/download/$DOWNLOAD_ID >> directory.tar
Download a directory as tar archive in a single request without resolving symlinks
curl -L -H "X-Auth-Token: $TOKEN" \
-X GET "https://$PROVIDER_HOST/api/v3/oneprovider/data/$DIR_ID/content?follow_symlinks=false"
See also Download file content by path.
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the file. |
Query parameters
| Parameter | Type & Description |
|---|---|
| follow_symlinks | boolean Flag controlling whether symbolic links in requested download should be resolved. |
Request Examples
oneprovider-rest-cli downloadFileContent id=$FILE_IDResponses
Entire file content.
No schema provided.
Part(s) of file content.
No schema provided.
Redirection URL for directory download.
Invalid request.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Forbidden request.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}File not found.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Internal server error.
| Property | Type & Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
error object (ErrorJson) Object describing an error.
| |||||||||||||||||||||||||||
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.0",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}