Summary: Providing an "Uploads:" markup similar to "Attach:", but with a storage-oriented way of referencing
Version: 1.1-beta2 (2007-12-19)
Status: Freshly released, awaiting comments
Maintainer: ThomasP
Categories: Uploads



see below


Include as usual in your local/config.php by



Sensible arguments to "Uploads:" look like:


Here absolute paths are interpreted relative to the upload root dir (usually uploads/). Relative paths are interpreted relative to the page's respective upload dir, as given by the new config variable $UploadPrefixPathFmt, which behaves like $UploadPrefixFmt, i.e. /$Group/$Name or /$Group or similar would be suitable settings. If no value is configured it defaults to the $UploadPrefixFmt setting.

There is no restriction on how deep or where exactly the file is located in the directory tree, only references trying to reach outside the overall upload dir are prevented.


  • Honors authorization restrictions (files will be downloadable using the usual download mechanism)
    • For files stored in the upload root dir, permission must have been granted for the $DefaultGroup.$DefaultName page.
    • For files stored in a group upload dir, permission must have been granted for the $DefaultName page in that group.
    • For files stored in subdirectories below a page upload dir, the permissions for that page must be have been granted.

Release Notes

See Also



(*) The referencing of uploaded files with the Attach: markup can be understood as two-stage process: first the argument provided to Attach: is mapped to a pagename that the attachment will be associated with, then this pagename is "translated" to the corresponding storage location using $UploadPrefixFmt. Thus the targeted file will have to lie within the scope determined by $UploadPrefixFmt.

In the Uploads: markup on the other side, the $UploadPrefixPathFmt setting is used only to determine the initial path ("current working dir"), starting from which the given file path argument is interpreted.

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.