File tools
Write files to the draft, upload an archive or read existing files.
On this page
Note
The connection covers the Space. You are a member, and the Space is not locked.
All five tools require Owner, Administrator or User, including reading files.
Warning
A new draft starts empty and contains no copy of the published version. hosting_deploy only publishes its contents; you need an index.html in the root folder.
No tool on this page requires a confirmation sentence; the application decides whether to ask you first.
How do the draft, app and log work together?
A project has at most one draft. The app interface writes to the same one as the tools. The project log records when a new draft is opened; it does not record writing and deleting files.
hosting_put_files Write files
changes datadeletes, overwrites or changes what visitors see
Writes to an existing or new draft. Matching paths are overwritten; files not named are retained.
One call allows 200 files and 3 MB. Invalid paths reject the entire call; if publications are used up or storage is full, nothing is created.
| Parameter | Type | Requirement | Description |
|---|---|---|---|
space | Integer | required | The ten-digit Space ID. |
project | Integer | required | The project number from hosting_list_projects. |
files | List of objects | required | 1 to 200 objects with path and content. Paths follow the path rules; encoding is optional: utf8 (default) or base64 for binary files. |
hosting_create_upload Create upload link
changes datadeletes, overwrites or changes what visitors see
Returns an upload address for a ZIP, TAR or TAR.GZ archive sent by HTTP PUT.
Warning
The upload replaces the entire draft with the archive's files. If the archive fails, the previous contents are retained.
- The call opens a draft if needed and replaces an earlier upload address. After upload, the draft remains open until you publish it.
- The address is valid once and for 15 minutes.
expires_atgives the deadline,max_bytesthe allowed size; at most 200 MB. - If the plan allows no further publication or storage is full, TEISENDA rejects the call and creates nothing.
| Parameter | Type | Requirement | Description |
|---|---|---|---|
space | Integer | required | The ten-digit Space ID. |
project | Integer | required | The project number from hosting_list_projects. |
hosting_delete_files Delete files
changes datadeletes, overwrites or changes what visitors see
Deletes up to 200 file paths from the draft. Completed versions remain unchanged.
The call stops at an invalid path; files listed before it may already have been deleted.
| Parameter | Type | Requirement | Description |
|---|---|---|---|
space | Integer | required | The ten-digit Space ID. |
project | Integer | required | The project number from hosting_list_projects. |
paths | List of texts | required | A list of 1 to 200 paths: the files the tool deletes from the draft. Follow the path rules. |
hosting_list_files List files
reads only
Lists a version's files, sorted by path.
The response contains at most 100 files; continue with next_offset.
| Parameter | Type | Requirement | Description |
|---|---|---|---|
space | Integer | required | The ten-digit Space ID. |
project | Integer | required | The project number from hosting_list_projects. |
deploy | Integer | optional | The number of a version in this project. If omitted, the tool uses the draft, otherwise the published version. |
offset | Integer | optional | How many files the tool skips. The default is 0; continue with next_offset from the previous response. |
limit | Integer | optional | The maximum number of files in the response. Default and maximum: 100. |
hosting_read_file Read file
reads only
Reads a file's contents.
- Files up to 200 KB, at most 40,000 characters per call. Continue with
next_offset. - File contents are marked as data; the application should not follow instructions contained in them.
| Parameter | Type | Requirement | Description |
|---|---|---|---|
space | Integer | required | The ten-digit Space ID. |
project | Integer | required | The project number from hosting_list_projects. |
path | Text | required | The file path, at most 240 characters; the path rules apply. A version's paths are shown by hosting_list_files. |
deploy | Integer | optional | The number of a version in this project. If omitted, the tool uses the draft, otherwise the published version. |
offset | Integer | optional | Where reading starts, in characters. The default is 0; continue with next_offset from the previous response. |
length | Integer | optional | The maximum number of characters in the response. Default and maximum: 40,000. |
These rules apply to paths
These rules apply to hosting_put_files, hosting_delete_files and hosting_read_file:
- The path is relative and uses forward slashes. It contains no backslashes or control characters.
- It has at most 240 characters and 12 levels.
- Each name has at most 100 characters and no leading or trailing whitespace.
- No name starts with a dot. The exception is the folder
.well-knownin the root folder.
In an archive, TEISENDA skips entries that violate these rules.
Check file and plan limits
The Connector file limits and plan limits apply. Storage counts all versions, drafts and backups; deleted versions no longer count.
A version that is too large is discarded at completion; older versions remain. Storage packages are available with a Max subscription.
If something goes wrong
Where a solution names a tool, ask the application to call it. If a message refers to Plans, follow the route to your plan in Space settings.
“This Space's plan allows … deployments; … have been used. Nothing was uploaded and no version was created. …”
The Space's plan allows no further publication; Free allows three in total. TEISENDA rejects hosting_put_files and hosting_create_upload, uploads nothing and creates nothing. Republishing a previously published version uses no publication and remains possible with hosting_rollback or with hosting_deploy and its number. Max offers more publications; see Free and Max plans.
“This Space's storage is full: … of … is used. Nothing was uploaded and no version was created. Delete versions or backups first. …”
The Space's storage is full, even accounting for what a new version would free. TEISENDA rejects hosting_put_files, hosting_create_upload and hosting_deploy. Delete versions or backups in TEISENDA. Max and its packages provide more storage; see Free and Max plans and Buy and cancel additional packages.
“Argument … is missing or does not have the expected form.”
An argument is missing or has the wrong form; the message names it. The same message appears for:
- more than 200 files for
hosting_put_files(argumentfiles), - more than 200 paths for
hosting_delete_files(argumentpaths), - a path exceeding 240 characters for
hosting_read_file(argumentpath), - an empty list.
Call the tool again with the argument in the form given in its description.
There is no open version. First put files in with hosting_put_files.
The project has no draft from which hosting_delete_files can delete. First write files with hosting_put_files.
“Version … does not exist in this project.”
The project has no version with the number given in the argument deploy. Check the project's versions with hosting_list_deploys.
A path isn't allowed. Paths are relative, use / and don't begin with a dot.
A file path violates the path rules. hosting_put_files then wrote nothing. hosting_delete_files has already deleted the files listed before the rejected path. Correct the path and call the tool again; after hosting_delete_files, use hosting_list_files to check what remains.
That's too much for one call. Split the files across several calls.
A call to hosting_put_files contains more than 3 MB of files. Split the files across several calls or upload an archive with hosting_create_upload.
The file is too large to read here.
The file exceeds 200 KB. A file of this size cannot be read through the Connector.
A file is too large.
An individual file exceeds 25 MB. Make the file smaller.
The version is too large overall.
The whole version exceeds 300 MB. Make the website smaller.
The version contains too many files.
The version contains more than 5,000 files. Reduce the file count.
The project has reached the maximum number of deployments. Delete an older one in TEISENDA first.
The hosting node will not open another version because it already holds 20 versions of this project, including versions deleted in TEISENDA but not yet removed from the node. If you recently deleted versions, wait a few minutes and try again. Otherwise, delete an older version in the app's version list on the project page. No Connector tool deletes a specific individual version.
The project is offline.
The project is offline. The hosting node therefore provides no upload address. The same message applies to every project in a Space TEISENDA paused after a subscription ended, even though the project's own switch is not set to offline; see Tools keep working in a paused Space. If the project's switch is set to offline, bring it online again with hosting_set_offline. This does not fix a paused Space.
The project hasn't been transferred to the hosting node yet.
TEISENDA has not transferred the project to the hosting node yet and cannot accept files. Query with hosting_project_status and try again once the node has the settings.
The hosting node rejected that.
The hosting node rejected something for which TEISENDA has no specific sentence. This is also how hosting_deploy_status and hosting_list_deploys show a version's problem after an unusable archive. In that case, call hosting_create_upload again: it uses the same version and issues a new address. Otherwise check the state with hosting_project_status; if it keeps happening, contact support.
This file doesn't exist in the version.
The version has no file at the path that hosting_read_file should read. Check the paths with hosting_list_files.
The offset … is past the end of the list (files in the version: …).
The offset for hosting_list_files is beyond the end of the list. Start again at offset 0 or continue with next_offset from the previous response.
The offset … is past the end of the file (characters in the file: …).
The offset for hosting_read_file is beyond the end of the file. Start again at offset 0 or continue with next_offset from the previous response.
Messages about the Space and project number are listed with the tools for Spaces and projects. All other messages that can occur with any tool are listed under Troubleshoot the Connector.