# Use the media library

> Upload images, PDFs and other files once in Media, find and rename them, add alt text and reuse them in as many entries as you like.

The media library holds every image and file in a project, so you upload a photo or a PDF once and reuse it in as many entries as you like. This page shows editors how to upload, organise and use media.

## Upload images and files

You upload files in **Media**, or directly from an entry's Images or Files field. Either way they land in the same library.

1. Open **Media** in the side navigation.
2. Click **Upload files** and choose the files, or drag them anywhere onto the page. While you drag, the page shows **Drop files to upload**.

In a library with no files yet, the same button is called **Upload your first files**.

You can upload up to 20 files at once, and each file can be up to 25 MB. Spatibase accepts images (JPEG, PNG, WebP, GIF, AVIF and SVG) and ordinary files such as PDFs, office documents, spreadsheets, GPX and KML. Owners and Editors can upload; Developers can view the library but not change it. An [AI assistant](https://spatibase.com/docs/ai/what-assistants-can-do/) with permission to edit drafts can upload files of up to 3.5 MB too, and the [`spatibase` command](https://spatibase.com/docs/build/cli/) uploads the images a data file points at. Uploaded files stay out of your live data until a draft that uses them is published.

## Find a file

The library lists the newest files first. Two tools narrow it down:

- **Search by file name** finds files whose name contains what you type.
- The **All**, **Images** and **Files** tabs show everything, only images, or only other files.

Search and the tabs appear once the library holds a file. Click a file to open its details; with the details open, the left and right arrow keys step to the previous and next file, and <kbd>Esc</kbd> closes them.

## Edit a file's name and alt text

Click a file to open **File details**. There you see its size, dimensions (for images), type and upload date, and you can change two things:

- **File name**: the name shown in the library and in the file's link.
- **Alt text** (images only): a short description for people who can't see the image. Screen readers and search engines use it everywhere the image appears.

Click **Save changes** (it is greyed out until something changed). The new name and alt text apply in every entry that uses the file. You can also edit both from the entry editor, next to the image or file.

> **Tip:** Write alt text that describes what the image shows, for example "Wooden boardwalk through a fern canyon", not "photo1".

## Copy a link to a file

**File details** shows **Link to this file** with a **Copy link** button. Use it to share a file or embed it somewhere else.

For an image, click its preview (or press <kbd>Enter</kbd>) to look at it full screen. Images also show a **Resized image (800 px wide, WebP)** link. Change the `w` (width), `h` (height) or `fmt` (format) values in that link to get other sizes and formats. Developers can read more in [Assets and images](https://spatibase.com/docs/reference/assets-and-images/).

## Use media in entries

Entries use media through elements (fields) of the Images or Files kind. In the entry editor, such a field lets you:

- drag files onto it to upload them (they are added to the library too);
- click **Choose from library** to pick files that are already uploaded;
- rename a file or edit an image's alt text (an image without one is marked **No description**);
- move files up or down to set their order;
- remove a file from the entry. The file stays in the library.

A field may limit which files it accepts, for example only web images, or only one file. The field tells you when a file does not fit. The entry saves by itself; mark it ready and publish for the change to reach your website or app. See [Add an entry on the map](https://spatibase.com/docs/content/entries/).

## Delete a file

Deleting a file takes it out of every entry that uses it, drafts and live data alike, at once (files don't wait for **Publish**), and moves it to the Trash. Links to the file stop working.

1. Click the file to open **File details**.
2. Click the **…** button (**More actions**) at the bottom left and choose **Delete…**.
3. Confirm with **Delete file**, or choose **Keep it**.

For 30 days you can restore the file from the Trash. A restored file comes back to the library and to the entry drafts that used it; mark those entries ready and publish to put it back in the live data. See [Activity and trash](https://spatibase.com/docs/team/activity-and-trash/).

## Related

- [Add an entry on the map](https://spatibase.com/docs/content/entries/)
- [Elements](https://spatibase.com/docs/model/elements/)
- [Assets and images](https://spatibase.com/docs/reference/assets-and-images/)
