Write file to server
Uploads one file of up to 50 MiB to a path on an SFTP or FTPS server.
@lainstack/file-server/write-file · Object storage
How to use it
Section titled “How to use it”Use Write file to server to upload one file of the run to a path on an SFTP or FTPS server. Pick the File from an earlier step, for example Read file from server, or from an upload field. It does not create content from text or data.
Good to know:
- The file can be at most 50 MiB, or the step fails. An upload field that holds no file or more than one fails, so limit the field to one file.
- If it exists is Fail by default: the step fails when the path is taken. Replace overwrites the existing file.
- The upload goes to a hidden part file in the same folder and is then renamed, so a reader never sees a half-written file. A failed upload removes its part file where the server allows it.
- Replace on a server that cannot rename over an existing file deletes the old file first and then renames. For a short moment no file exists at that path.
- If the connection drops mid-way, the step fails with an unknown outcome. The file may or may not be there, so check the server before running it again.
- File path is relative to the connection’s root folder. The folder must already exist.
Settings
Section titled “Settings”| Setting | Key | Type | Details |
|---|---|---|---|
| SFTP or FTPS connection (required) | credentialId |
Connection | Uses the selected SFTP or FTPS connection. At most 255 characters. |
| File path (required) | path |
Text | Path relative to the connection’s root folder. |
| File (required) | file |
Value | The file to upload, from an earlier step or an upload field. One file only. |
| If it exists | ifExists |
One of Fail the step, Replace it |
Default fail. |
Outputs
Section titled “Outputs”| Output | Path | Type |
|---|---|---|
| Size | size |
Number |