Skip to content

The Media library: upload, find and organize your files

Describes PhoenixKit 3.5.0.

Every image, video, document and other file uploaded to a PhoenixKit site lives in the media library. The Media page is where you upload files, look them up, sort them into folders and clean up what is no longer needed.

Where to find it

In the admin sidebar, open Media (/admin/media). You need the Owner or Admin role, or a role with the Media permission.

What you see depends on your rights:

  • An Owner or Admin, or a role that also has See everyone’s files, sees every file in the library.
  • A role with Media but without See everyone’s files sees only its own files: the files that person uploaded, the folders they created or that hold their files, and the folders above those.

Before anything can be uploaded, at least one storage bucket must exist (see the guide on storage buckets). Without one, the upload area shows No Storage Buckets Configured with a Configure Storage Buckets link.

The PhoenixKit Media page: the folder tree with All Files, Top level, Boards and Trash on the left, and the Top level folder with Grid, sort, type filter and Add Media The PhoenixKit Media page: the folder tree with All Files, Top level, Boards and Trash on the left, and the Top level folder with Grid, sort, type filter and Add Media

The Media page: folders on the left, their contents on the right.

Uploading files

Press Add Media in the toolbar to open the Upload Media area, then pick files or drop them on it. The area says how large one file may be and how many files one selection may carry, for example “500MB per file, up to 100 files at once”. Both limits are set on Settings → Media → Configuration. Cancel closes the area again.

Files you add while a folder is open go into that folder. You can also drop files from your computer onto an open folder: an empty folder says This folder is empty. and Drop files here or click “Add Media” to upload.

Uploads are sent a few at a time, not all at once. A panel shows what is in flight and what is left, and each file can be paused, skipped or cancelled. When resumable uploads are on (the default), a paused file carries on from where it stopped, and a lost connection or a reloaded page does not start it over.

If an upload does not land, it stays in a list above the files with the reason. Retry (or Resume) sends it again, Discard lets it go, and Retry all and Discard all act on the whole list.

If you upload a file you already uploaded to the same library, it is not stored a second time: you get the file you already have.

The sidebar

The sidebar on the left lists your folders under Folders, plus three fixed entries:

  • All Files: every file, whichever folder it is in.
  • Top level: files that are in no folder, and the top folders.
  • Trash: what has been moved to the trash.

The sidebar can be collapsed with Collapse sidebar and brought back with Show folders. Working with folders has its own guide.

Finding files

The toolbar above the files narrows and orders what you see:

  • Grid, List and Stacks: three ways to show the files. Stacks shows each folder as a pile of its pictures that opens in place, with loose files under Everything else.
  • Sort: Newest first, Oldest first, Date taken, oldest first, Date taken, newest first, Name A–Z, Name Z–A, Largest first, Smallest first.
  • The file type menu: All types, Images, Videos, Documents, Audio, Archives, Other.
  • Shape: All shapes, Panoramas (2:1 or wider) and Tall (1:2 or taller). Panoramas also carry a small Panorama badge on their tile.
  • The magnifying glass opens Search files…. With no match the page says No files match your search.

When a page holds more files than fit, Prev and Next under the grid move between pages.

Opening a file

Click a file to open it in the viewer: a large preview with a details panel beside it. Arrow keys step through the files of the page. What the panel holds (title, alt text, tags, details, the Storage page) is covered in the guide on file details.

Each file tile also has a menu of its own:

  • Download.
  • Edit image: crop, turn, mirror, straighten, hide areas (blur, pixelate or a black box), brightness and contrast. Only still JPEG, PNG, WebP, AVIF, TIFF and BMP images can be edited.
  • Rotate left and Rotate right (images): the turn is saved on the file, so everyone sees it turned.
  • Move: choose another folder.
  • Move to Trash, or in the Trash, Restore and Delete Permanently.

Working with many files at once

Choose Select from the More actions menu (or drag a box over the files, or Shift-click) to pick several files and folders. The toolbar then shows how many are selected, with Select all, Clear and these actions:

  • Move: into a folder.
  • Download.
  • Delete: moves the selection to the trash. In the Trash view the same button says Delete permanently.
  • Restore (in the Trash view).

Cancel or the Escape key leaves selection mode without doing anything.

The trash

A file you delete goes to the trash first. Its bytes are kept, and it can be restored until the trash retention period is over (30 days unless changed on Settings → Media → Configuration); then it is deleted for good.

Open Trash in the sidebar to see it. From there:

  • Restore brings a file or folder back. A file whose folder is in the trash too comes back into the nearest folder that still exists, or the top level. Dragging a trashed file onto a folder restores it there.
  • Delete Permanently removes one file for good, after a confirmation.
  • Empty Trash deletes every file in the trash view for good, after asking “Permanently delete all … trashed files?”.

If your site has told PhoenixKit where else its files are used (an order’s attachment, a page’s picture), a file that is still in use is not deleted. A dialog lists where it is used, and the file stays in the trash.

Orphaned files

An orphaned file is one no record points to any more. Settings → Media → Tools has Find Orphaned Files, which opens Media showing only those (/admin/media?orphaned=1). There, Move all orphaned to trash moves them all to the trash, after a confirmation. They can still be restored from there.

PhoenixKit only knows the references its own features make. If your site’s own tables point at files, a developer has to register them first, or those files will look orphaned.

Several libraries

A site can keep more than one library (see the guide on libraries). As soon as there is more than one you can open, the page title becomes the library’s name with a switcher beside it, Switch library, where each entry is marked Site or Mine. A library a module keeps for its own files may show here as Read only, with the note These files belong to the module that stored them and cannot be changed here.

What it doesn’t do

  • Files never move between libraries: you cannot move or link a file into another library’s folder.
  • Restoring is only possible while a file is in the trash. Once the retention period is over, or after Delete Permanently or Empty Trash, it is gone.
  • Animated images (such as GIFs), files in the trash and files a module manages cannot be edited with Edit image.

For developers

To protect files your own tables reference from the orphan cleanup, set config :phoenix_kit, :protected_file_uuids or config :phoenix_kit, :file_reference_sources. To stop a file in use from being deleted, name a module in config :phoenix_kit, :file_removal_guard (the PhoenixKit.Modules.Storage.RemovalGuard behaviour).