# Manage files

> See what uses your disk, then download, rename, delete, and edit files from the dashboard. Add files through WordPress, SFTP, or Git.

Source: https://docs.wpwaterfall.com/files-manager

The Files tab shows what takes up space on an environment and gives you a file manager to download, rename, delete, and edit files. It does not upload files or make folders: see [How do I add files?](#how-do-i-add-files). Open a site, pick the environment in the top bar, and choose **Files**.

## What does the tab show?

You see disk usage, the largest folders and files, and the file manager below them. The usage is measured each time you open the tab. The limit is the disk quota of the site, from its tier and any Additional disk space. A warning appears near the limit, and again when the site has used all of it.

## How do I browse and edit?

Open a folder to list what it holds. Open a text file under 1 MB to edit it in place. Save writes it back to the environment.

Press Escape, then Tab, to leave the editor with the keyboard.

## How do I download, rename, or delete?

Download saves a copy of a file to your computer. Rename from the row. Deleting asks you to type the file name.

## How do I add files?

The Files tab does not take uploads and does not make folders. Add files in one of these ways:

- **The WordPress dashboard.** The media library puts pictures and documents in `wp-content/uploads`, on every environment, live included. One upload can be [at most 100 MB](https://docs.wpwaterfall.com/tools-php-settings#how-large-a-file-can-i-upload). On staging or a preview in SFTP mode, WordPress can also install plugins and themes.
- **SFTP.** Connect with the credentials on the [Info tab](https://docs.wpwaterfall.com/site-info). Your client can upload files and make folders. On an environment in Git mode, code folders are read-only over SFTP, and `wp-content/uploads` stays writable. On live, an [additional SFTP user](https://docs.wpwaterfall.com/ssh-and-sftp#extra-sftp-accounts) made with **Read, and upload to the uploads folder** can read every file and add files to the uploads folder.
- **Git.** Push code to staging or a preview, then promote. See [How Git deploys work](https://docs.wpwaterfall.com/code/git-workflow).

Files you add this way appear in the Files tab after you refresh the list.

## Which folders are writable on live?

Live runs a read-only release of your code, but two folders stay writable on every environment, live included. They hold your site's own files, not code:

| Folder | What it holds | Backups and copies |
|---|---|---|
| `wp-content/uploads` | The media library, form attachments, import files, generated CSS, and anything else plugins save. | In every backup and restore point. Copied to a new staging or preview. A promote leaves live's uploads alone unless you choose **Copy new uploads from staging**, which only adds files. |
| `wp-content/cache` | Files plugins rebuild, such as minified CSS and JavaScript. Limited to 2 GB. | Not backed up, copied, or promoted. Empty it whenever you like. |

On live you can browse, download, edit text files, rename, and delete inside these two folders. You cannot delete or rename the folders themselves, only what is inside them. Uploads count against your disk space like everything else.

PHP never runs in these folders. A file that ends in `.php`, `.phtml`, `.phar`, `.phps`, `.pht`, or `.php` followed by a digit answers "403 Forbidden" when someone opens it, and the Files tab refuses to save one there. Put PHP in your repository on staging and promote it.

Files in uploads on live belong to live. A promote copies code only unless you choose **Copy new uploads from staging**. That option merges: it adds staging's new and updated files to live, never deletes a file that only live has, keeps a live file that is newer than staging's copy, and takes a restore point of live first. **Overwrite files that differ** is a separate choice that also replaces those newer live files. Staging and previews start with a copy of live's uploads, and the **Clone database and files** card refreshes them from live. When you launch live from staging, staging's uploads are copied to live once.

## Why is code read only on live?

Everything outside the two data folders is code, and code is a read-only release on live and in Git mode. The file manager writes code only on staging or a preview in SFTP mode. On live it is view and download only, and the note above the list says: "Live code is read only. Only the uploads and cache folders accept changes here. Change code on staging, then promote it to live." **Promote from staging** opens the promote panel. In Git mode, switch the mode with the **SFTP | Git** switch on the **Code** card on **Info**. The data folders still take changes there. The reasons and the full flow are in [How Git deploys work](https://docs.wpwaterfall.com/code/git-workflow).

The API answers a change to live code with 409 `live_is_immutable` before it makes a job. PHP in a data folder answers 422 `php_upload_refused`, and deleting or renaming a data folder itself answers 422 `data_folder_protected`.

`wp-content/mu-plugins` is code too, so the same rules apply to it: on staging or a preview in SFTP mode your own must-use plugins there take changes, and everywhere else they come through Git. Two entries in it are the WP Waterfall plugin, `wpwaterfall.php` and the `wpwaterfall` folder. They are read only on every environment, and a change to them answers 409 `code_is_read_only`. The folders that hold them, `wp-content` and `wp-content/mu-plugins`, cannot be deleted or renamed. See [Your own must-use plugins](https://docs.wpwaterfall.com/plugins#your-own-must-use-plugins).

You need the Files permission to change anything here: Owners, Admins, Developers, and Site Admins and Site Developers on their own sites have it. Viewers and Billing users do not see the Files tab. WP Waterfall support, under a grant you allow, follows the same rules as you do.

## Quick answers

**Can I add pictures to the media library on live?**
Yes. Add them in wp-admin or over SFTP. They stay on live through every promote, rollback, and restart.

**Why is my PHP file refused in uploads?**
PHP never runs in the uploads or cache folders. Add the file to your repository on staging and promote it.

**Can I add a must-use plugin?**
Yes, in `wp-content/mu-plugins`, wherever code is writable: on staging or a preview in SFTP mode, or through Git. Give it any name but `wpwaterfall.php` or `wpwaterfall`, which are the WP Waterfall plugin.

## API

- `GET /v1/environments/{id}/files/usage`
- `GET /v1/environments/{id}/files`
- `PATCH /v1/environments/{id}/files`
- `DELETE /v1/environments/{id}/files`
- `GET /v1/environments/{id}/files/download`

## Related

- [Site information](https://docs.wpwaterfall.com/site-info)
- [How Git deploys work](https://docs.wpwaterfall.com/code/git-workflow)
- [Backups](https://docs.wpwaterfall.com/backups)
