Arbitrary static public domain files (www)
Overview
Provides access to files in the shared directory of publicly available domain files. Files contained in the directory can be obtained by accessing any web server at /public/<DOMAIN>/<PATH>/<FILENAME>. `<PATH>` is an arbitrary path corresponding to the upload path relative to `/rest/v1/fs/targets/www/`
Nested structure of arbitrary depth is supported. When placing a file the path is created automatically; when deleting a file empty directories are removed automatically.
The directory is located in the category of automatically synchronized directories :SYNC.
Available in any domains.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Uploading a group of files
Upload to the collection is performed with Content-Type: multipart/formdata.
The request may contain one or several files.
Files are placed under the names specified in the Content-Disposition headers of each part.
If a file with the specified name already exists, it is not saved and an error is returned. Depending on the Content-Type and the presence of successfully placed files, either a failed HTTP response or failure information in the body of a 200 OK HTTP response may be returned.
The directory to which the upload is performed must exist: accessing a nonexistent directory returns 405 Method Not Allowed.
To place a file together with missing path directories, use the PUT method.
Request
POST /rest/v1/fs/targets/www HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e
-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="filename"; filename="doc_123.html"
Content-Transfer-Encoding: binary
BINARY BODY OF 'doc_123.html'
-----------boundary_69df8120352a996e--
Getting the list of files
Request
| Name | Type | Description |
|---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: name, size, last_modified. |
|
|
Offset in the list of files to output. |
|
|
Maximum number of files in the list. |
|
|
Sorting order of files in the list. |
|
|
When It is counted after applying the filter: with the |
GET /rest/v1/fs/targets/www HTTP/1.1
Response
The time in the last_modified field is returned in UTC.
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"last_modified": "2021-12-20 20:03:59",
"name": "a",
"type": "directory"
},
{
"last_modified": "2021-12-20 20:04:35",
"name": "aaa.mp3",
"size": 193559
}
]
Downloading a file
Request
| Name | Type | Description |
|---|---|---|
|
|
Output type. Default
|
GET /rest/v1/fs/targets/www/doc_123.html?attachment=true HTTP/1.1
Re-uploading an existing file
Replaces the file.
A single file is uploaded either with Content-Type: multipart/formdata
or with an arbitrary non-multipart Content-Type.
If the upload uses Content-Type: multipart/formdata,
only the first file is saved (the first part having a filename field in the
Content-Disposition header), and the file name itself is ignored.
The file name is always taken from the URL.
If the file at the specified path does not exist, it is created along with missing path directories.
A request with Content-Type: application/octet-stream and zero body length creates an empty file.
A request without a body, without Content-Type, and without the X-Era-Source header is rejected with code 400:
the intent cannot be determined from such a request.
The PUT method has another meaning with a different request form: Move and rename a file.
In sections with nested structure, PUT on a path with a trailing slash creates a directory, see Directory operations.
Request
PUT /rest/v1/fs/targets/www/doc_123.html HTTP/1.1
Content-Type: application/octet-stream
BINARY BODY OF 'doc_123.html'
PUT /rest/v1/fs/targets/www/doc_123.html HTTP/1.1
Content-Type: multipart/form-data; boundary=-----------boundary_69df8120352a996e
-----------boundary_69df8120352a996e
Content-Type: application/octet-stream
Content-Disposition: form-data; name="doc_123.html"; filename="doc_123.html"
Content-Transfer-Encoding: binary
BINARY BODY OF 'doc_123.html'
-----------boundary_69df8120352a996e--
Getting file metadata
Returns file metadata, including the size in the Content-Length header.
Request
| Name | Type | Description |
|---|---|---|
|
|
Output type. Default
|
HEAD /rest/v1/fs/targets/www/doc_123.html?attachment=true HTTP/1.1
Getting file metadata (METADATA)
Returns the file size and modification time in JSON format. Unlike the HEAD method,
the information comes in the response body and does not require parsing headers.
The method is non-standard and is accepted in two equivalent forms: by the method itself
(METADATA /rest/v1/fs/targets/www/doc_123.html) and by POST on a path with the suffix
(POST /rest/v1/fs/targets/www/doc_123.html!metadata). More — Non-standard methods in the path.
The request must not contain a body in either form: a request with a body is treated as a file upload.
Specifics
-
The time in the
mtimefield is returned in UTC in RFC 3339 format. -
The content checksum is returned only on a request with the
hasha=trueparameter. Without the parameter the file content is not read, so the request is cheap regardless of file size.
Request
| Name | Type | Description |
|---|---|---|
|
|
Add a content checksum to the response. Default Calculation requires reading the entire file, so for large files the parameter should be specified only when explicitly necessary. |
POST /rest/v1/fs/targets/www/doc_123.html!metadata HTTP/1.1
Response
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"size" : 3836,
"mtime" : "2026-07-01T16:47:31Z"
}
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"size" : 3836,
"mtime" : "2026-07-01T16:47:31Z",
"hasha" : "md5;9f86d081884c7d659a2feaa0c55ad015"
}
Move and rename a file
Moves or renames a file within a section without transferring its content.
Performed by PUT on the destination path with the X-Era-Source header and an empty body.
The header specifies the source path relative to the section root.
Directory operations
The section supports nested directories of arbitrary depth, so directory operations are available in it.
| Request | Action |
|---|---|
|
Create a directory. The path is specified with a trailing slash, the request body is absent. |
|
Delete an empty directory. |
|
Delete the directory with its contents. Requires key confirmation. |
|
Clear the directory, leaving it in place. Requires key confirmation. |
Deleting and clearing a non-empty directory are performed with two requests: the first deletes nothing and returns a confirmation key along with the scope of the upcoming operation, the second performs the operation with this key.
The section root cannot be deleted (405), but it can be cleared.
More, together with the confirmation key and limits description: Directory operations.
Downloading and uploading a directory as an archive
| Request | Action |
|---|---|
|
Download the directory as one archive. |
|
Upload a file structure from an archive into the directory. |
An archive containing an escape beyond its boundaries — entries with .., absolute paths, or symbolic
links outside — is rejected entirely with code 422.
Section root operations
In addition to listing and uploading files, the section root supports two methods.
| Request | Action |
|---|---|
|
Section description and information about its root: supported operations, limits, number of top-level elements. |
|
Clearing the section: all contents are deleted, the section itself remains. The operation is recursive and requires key confirmation. |
The section cannot be deleted: DELETE on the root path always returns 405.
More: Metadata and Directory operations.