# urbestack-file-write

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-file-write --user NAME --path /file [--create-only] --content-stdin
urbestack-file-write --user NAME --path /file [--create-only] --bytes-stdin --length BYTES
```

## Description

Writes the entire contents of a file in the customer's home directory from standard input, up to the size set by files.upload_limit_mb. The --path value starts at /, the customer's home directory.

Use --content-stdin to send base64, as the built-in editor does. The command reads the entire input before writing. Use --bytes-stdin to stream raw bytes for an upload. With --bytes-stdin, --length is required and gives the exact byte count. Use 0 for an empty file. The command streams the bytes to a hidden file beside the destination and moves it into place only after receiving the declared number of bytes. If input ends early, the command returns a 400 error and leaves the destination as it was.

Use --create-only to prevent replacement. If the file exists, the command returns a 409 error. The New file button and uploads that ask before replacing a file use this option.

The command writes as the customer, creates new files with mode 0644 and refuses to write through symbolic links. Running out of disk space returns a 507 error.

## Same in the API

- [PUT /files/{user}/content](https://urbestack.com/docs/api/put-files-user-content.md): Write the entire contents of a file

## Command family: file

- [urbestack-file-chmod](https://urbestack.com/docs/commands/urbestack-file-chmod.md): Changes permissions on entries in a customer's home directory using that customer's account.
- [urbestack-file-compress](https://urbestack.com/docs/commands/urbestack-file-compress.md): Creates a new .zip archive in a customer's home directory using the distribution's zip under the customer's account.
- [urbestack-file-copy](https://urbestack.com/docs/commands/urbestack-file-copy.md): Copies entries into an existing directory using the customer's account.
- [urbestack-file-delete](https://urbestack.com/docs/commands/urbestack-file-delete.md): Permanently deletes the selected entries using the customer's account, including all contents of selected directories.
- [urbestack-file-download](https://urbestack.com/docs/commands/urbestack-file-download.md): Streams a download from a customer's home directory to standard output using the customer's account.
- [urbestack-file-extract](https://urbestack.com/docs/commands/urbestack-file-extract.md): Extracts an archive in a customer's home directory with the customer's filesystem permissions.
- [urbestack-file-list](https://urbestack.com/docs/commands/urbestack-file-list.md): Lists the entries in a directory of a customer's home, with directories first.
- [urbestack-file-mkdir](https://urbestack.com/docs/commands/urbestack-file-mkdir.md): Creates one directory with mode 0755 using the customer's account.
- [urbestack-file-move](https://urbestack.com/docs/commands/urbestack-file-move.md): Moves entries within the customer's home directory using the customer's permissions.
- [urbestack-file-read](https://urbestack.com/docs/commands/urbestack-file-read.md): Returns a file's entry and base64-encoded contents using the customer's permissions.
- [urbestack-file-rename](https://urbestack.com/docs/commands/urbestack-file-rename.md): Renames or moves one entry within the customer's home directory using the customer's permissions.
- [urbestack-file-restore](https://urbestack.com/docs/commands/urbestack-file-restore.md): Restores entries from the customer's Trash to their original directories using the customer's permissions.
- [urbestack-file-size](https://urbestack.com/docs/commands/urbestack-file-size.md): Measures the disk space used by a directory in the customer's home.
- [urbestack-file-trash](https://urbestack.com/docs/commands/urbestack-file-trash.md): Moves entries to the customer's Trash using the customer's permissions.
- [urbestack-file-trash-list](https://urbestack.com/docs/commands/urbestack-file-trash-list.md): Lists all entries in the customer's Trash using the customer's permissions, newest deletion day first.
