> 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/public-links.md).

# Public links

Give a file or a whole folder a link anyone can open without signing in, and take it back.

**Where:** Files → Browser → click a file (or **View** on a folder) → **Make public** · `/projects/<project>/files/browser`

A file is private by default: only people signed in to the project, or an app with a short-lived signed link, can read it. **Make public** gives the file — or every file in a folder — a fixed link that anyone can open, for example a product picture on your shop page.

## Before you start

* The file exists — see [Upload files](/codemash/cloud/files/browser/upload.md). The root of a storage cannot be made public.
* A public link needs no sign-in and no key: anyone who has it can read the file. Share it like you would publish it.

## Steps

1. In **Files → Browser**, open the file's panel, for example `spring-2026-catalog.pdf` in `catalog`. Under **Public access** it says *Only people signed in to this project can read this file.*

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-ceaa2eb8b83076c0c97547f470b9acef793c8ebd%2Fpublic-links-1.png?alt=media" alt="File panel of spring-2026-catalog.pdf: Path catalog/spring-2026-catalog.pdf, Public access Only people signed in to this project can read this file, Make public"><figcaption><p>A private file.</p></figcaption></figure>
2. Press **Make public**. The panel shows the **Public** badge, the text *Anyone with the link can read this without signing in.*, the link with a copy button (**Copy public link**), and the button changes to **Make private**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-f763db54ee96a3adcf17acb80360fb2598ae9531%2Fpublic-links-2.png?alt=media" alt="File panel of spring-2026-catalog.pdf with the Public badge, the link http://dsfl.norbix.test:5002/v3/files/public/nbpf_6RKxnCJoiSnkceHqaEPet0/spring-2026-catalog.pdf, a copy button and Make private"><figcaption><p>The file is public; copy the link.</p></figcaption></figure>

   The link has the shape `<Api address>/v3/files/public/<publicId>/<file name>`, for example `…/v3/files/public/nbpf_6RKxnCJoiSnkceHqaEPet0/spring-2026-catalog.pdf`.
3. To make a whole folder public, go back up to the folder and press **View** at the end of the folder's row, for example `mugs`. The panel shows **Folder** and *Only people signed in to this project can read the files in this folder.* Press **Make public**.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-1f536a159acb7f46167b7dcdd0ab19bab7feca2b%2Fpublic-links-3.png?alt=media" alt="Panel of the folder mugs: Folder, Path mugs, Public access Only people signed in to this project can read the files in this folder, Make public"><figcaption><p>The panel of a folder.</p></figcaption></figure>

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-1b44cb051a0068386655df596c96b372e2234570%2Fpublic-links-4.png?alt=media" alt="Panel of the folder mugs with the Public badge, the folder link http://dsfl.norbix.test:5002/v3/files/public/nbpf_4e1GGToJ1ejkH8xJ52iBO/ and Make private; behind it the list shows mugs as Public"><figcaption><p>The folder is public.</p></figcaption></figure>

## Result

The **Public** column shows **Public** on the row. Inside a public folder every file — also the ones uploaded later, at any depth — shows **Public (folder)** and has its own link: the folder link plus the file's path, for example `…/v3/files/public/nbpf_4e1GGToJ1ejkH8xJ52iBO/blue-mug.png`.

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-fe842764907c15b663ed8dcd8d492fbd0aa0a11d%2Fpublic-links-5.png?alt=media" alt="The folder mugs: blue-mug.png, green-mug.png and red-mug.png, each marked Public (folder)"><figcaption><p>Files in a public folder.</p></figcaption></figure>

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-41ee9fc236ff936a3e8ce19586da8e50b31c1892%2Fpublic-links-6.png?alt=media" alt="Panel of blue-mug.png with the badge Public (folder), the text Anyone with the link can read this, because a folder above it is public. Make that folder private to take the access away., the link …/nbpf_4e1GGToJ1ejkH8xJ52iBO/blue-mug.png, and no Make public or Make private button"><figcaption><p>A file that is public through its folder has no switch of its own.</p></figcaption></figure>

A signed-out request to a link answers with the file (`200`, for example `application/pdf`); browsers may keep it for up to five minutes (`Cache-Control: private, max-age=300`). The folder link alone, a wrong file name and a link that was switched off all answer `404` — there is no public folder listing.

## Change or remove it later

* **Make private** on the same file or folder takes the link away at once (`404`). Making it public again gives a **new** link.
* A file that is public through its folder cannot be made private on its own — the server answers *"mugs/red-mug.png" is public because the folder "mugs/" is public. Make "mugs/" private, or move the file out of it.* Make the folder private instead.
* Making a folder private also takes away the links of every file inside it.
* [Delete the file](/codemash/cloud/files/browser/delete.md) — its link stops working.

## Do it from code

```ts
const { id } = await norbix.hub.files.makeFilePublic({ filesIntegrationId, path: 'shipping-terms.txt' }); // nbpf_…
const { publicUrl } = await norbix.api.files.getFileInfo({ filesIntegrationId, path: 'shipping-terms.txt' });
// http://dsfl.norbix.test:5002/v3/files/public/nbpf_3ZtwbzkPWQRpqe8TLaVUbA/shipping-terms.txt
await norbix.hub.files.makeFilePrivate({ filesIntegrationId, path: 'shipping-terms.txt' });
await norbix.hub.files.makeFolderPublic({ filesIntegrationId, path: 'mugs' });
```

```sh
norbix hub files file public make --filesIntegrationId int_45rkbZX4ecZBkiv6gXe5Da --path shipping-terms.txt
```

The CLI also has `norbix files publish <path>` (and `--folder`), but in CLI 1.16.0 it sends the project in a header the server does not read (`X-CM-ProjectId`) and answers *Property ProjectId is required* — use `norbix hub files file public make` as above. The client setup is there too. API: [Make File Public](/codemash/api-reference/files/item/make-file-public.md) · [Make File Private](/codemash/api-reference/files/item/make-file-private.md) · [Make Folder Public](/codemash/api-reference/files/folder/make-folder-public.md) · [Make Folder Private](/codemash/api-reference/files/folder/make-folder-private.md) · [Get Public File](/codemash/api-reference/files/public/get-public-file.md)
