> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/files/browser/edit.md).

# Preview, download or replace a file

Open a file's panel to preview it, copy its path, download it, or replace it with a new version.

**Where:** Files → Browser → click a file · `/projects/<project>/files/browser`

A file in Files has no fields to edit: its name is its path. You open its panel to look at it and download it, and you change it by uploading a new version under the same name.

## Before you start

* The file exists — see [Upload files](/codemash/cloud/files/browser/upload.md).

## Steps

1. In **Files → Browser**, open the folder and click the file name, for example `red-mug.png` in `mugs` (or press **View** at the end of the row). The panel opens on the right:

   | Part          | What it shows                                                                                                                              |
   | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
   | Preview       | A picture for `png`, `jpg`, `jpeg`, `gif`, `webp` and `svg` files (loaded through a short-lived signed link); a page icon for other files. |
   | Name and size | `red-mug.png`, `0.00 MB`, and the **Public** badge when the file is public.                                                                |
   | Information   | **Extension** (`png`) and **Provider** (`Local`).                                                                                          |
   | Path          | `mugs/red-mug.png`; the copy button next to **Path** copies it.                                                                            |
   | Public access | Who can read the file, and **Make public** / **Make private** — see [Public links](/codemash/cloud/files/browser/public-links.md).         |

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-9fe5f1af3da81d689f9ceab3465100fcf6d889fb%2Fedit-1.png?alt=media" alt="File panel of red-mug.png: a red mug picture, 0.00 MB, Information Extension png and Provider Local, Path mugs/red-mug.png with a copy button, Public access Only people signed in to this project can read this file, Make public, Download and Delete"><figcaption><p>The panel of a file.</p></figcaption></figure>
2. Press **Download** to save the file. The browser saves it with its own name (`red-mug.png`).
3. To replace the file, close the panel (the **×** at the top left of the panel), stay in the same folder, press **Upload file** and pick a file with the **same name**. The message says **Upload done** (*red-mug.png uploaded*), and the list still has one `red-mug.png` — the new version.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-ff2fdf0b18d3c327a19cfb8e7d7cd36ce5392bf5%2Fedit-2.png?alt=media" alt="Upload done, red-mug.png uploaded, over the folder mugs, which still lists blue-mug.png, green-mug.png and red-mug.png once each"><figcaption><p>The new version replaced the old one.</p></figcaption></figure>

## Result

**Download** gives you the stored bytes. A replaced file keeps its path, so every link and every record that points at `mugs/red-mug.png` now gets the new version; a public link keeps working. The replacement fires the **When uploaded** [triggers](/codemash/cloud/files/triggers.md) again.

To rename or move a file, upload it under the new path and [delete](/codemash/cloud/files/browser/delete.md) the old one — there is no rename.

## Change or remove it later

* **Share** — [Public links](/codemash/cloud/files/browser/public-links.md).
* **Delete** — [Delete a file](/codemash/cloud/files/browser/delete.md).

## Do it from code

```ts
const { file } = await norbix.api.files.getFileInfo({ filesIntegrationId, path: 'mugs/red-mug.png' });
console.log(file.resource.originalFileName, file.resource.sizeBytes, file.isPublic); // red-mug.png 1691 true

const { url } = await norbix.api.files.getSignedUrl({ filesIntegrationId, path: 'mugs/red-mug.png', expirationSeconds: 300 });
const res = await fetch(url); // 200 image/png, 1691 bytes — no sign-in needed while the link is valid
```

```sh
norbix api files file info get --filesIntegrationId int_45rkbZX4ecZBkiv6gXe5Da --path mugs/red-mug.png
```

Replace from code with the same three upload calls and the same `path` — see [Upload files](/codemash/cloud/files/browser/upload.md#do-it-from-code). The client setup is on the [Files page](/codemash/cloud/files.md#use-it-from-code). API: [Get File Info](/codemash/api-reference/files/info/get-file-info.md) · [Get Signed Url](/codemash/api-reference/files/sign/get-signed-url.md) · [Download File Api](/codemash/api-reference/files/download/download-file-api.md)
