Skip to content

Locations 0.5.1: Files folders under a parent folder, with names you choose

Locations 0.5.1 lets a Phoenix app decide where the files folders of the PhoenixKit locations module go and what they are called, instead of every folder sitting at the storage root as location-<uuid>.

Two new settings take a module and function from the host app. :attachments_parent_folder returns the folder under which a location’s or space’s folder is created; :attachments_folder_name returns a readable name for it, such as the location’s own name. Without them nothing changes. Folders made before the settings are still found: the module looks for the chosen name under the parent, then the old name under the parent, then the old name at the root.

Names are not unique, so a folder found by name is used only when no other location or space already points at it. A location can never show another location’s files, even one belonging to another account. A name already taken falls back to the location-<uuid> name.

Fixed along the way: renaming a freshly created upload folder could move its files to the storage root, and a hook that raises is now logged and treated as “no setting” instead of crashing the form during an upload.

Full release notes: Locations 0.5.1

0.5.1 · 15 September 2026

Added

  • Attachment folders can be created under a host-configured parent (:attachments_parent_folder); the host can also name them (:attachments_folder_name). Lookups check the host name under the parent, then the deterministic name under the parent, then the root.

Fixed

  • A folder found by its host name is adopted only when no other location or space points at it, so a same-named location (possibly another account’s) never shows or stores another location’s files. A host name already taken under the parent falls back to the deterministic location-<uuid> name.
  • The pending-folder rename changes only the name again. It passed no actor, so an actor-dependent parent hook moved freshly uploaded files to the storage root.
  • A raising parent or name hook is logged and treated as nil instead of crashing the form mid-upload.

Locations 0.5.1. Install or update: {:phoenix_kit_locations, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.