Sites file¶
Keeps private files to the sites of the content that uses them; the module is experimental. A file belongs to the sites of the page, media item or site setting that holds it, like the photo in the group's press release, and follows that content to new sites. On a site's hostname, a private file of other sites is refused, image styles included, and a form there cannot attach it; the hub and users with Administer sites reach every file. The web server serves public files without this check.
Install¶
Ships with Sites; with that project in the codebase:
drush en sites_file
Requires Sites, file (core).
Configure¶
sites_file.settings has no form. Set its keys with Drush or in
settings.php: enforce_download_access (default true) switches both
refusals, and upload_directory_prefix puts the uploads made on a site's
hostname into a directory of their own, like sites/[current-site:id]
(Files and media).
Where a site must keep its files to itself, set the file field's Upload destination to Private files (Media and files).
Last updated 2026-10-16