Questions answered by this recipe
How can I organise uploaded files in different ways for different groups or pages?
Enhanced upload script adding capacity to organise uploads on a per group or per page basis
This script allows uploads to be organised by Group and by Group/Name/ subfolders as required for different groups, by setting an array $UploadPrefix, instead of using
$UploadPrefixFmt, eg.'Special' group uploads organised in subfolders per page:
$UploadPrefix['Special'] = '/$Group/$Name';
Make sure uploads are enabled by setting
$EnableUpload = 1;.
Uploadplus works in addition to the PmWiki upload.php script.
The admin can add $UploadPrefix array elements to define upload file prefixes for groups or pages as needed. The array key needs to be a group name or a full page name (with a dot separator like Group.Name).
$UploadPrefix['default'] is used for the sitewide default prefix. The upload prefix is always added to the uploads directory (set by
$UploadDir, default is 'uploads'), before the file name.
$UploadPrefix['Special'] = '/$Group/$Name';- Files attached to pages in the Special group will be stored in one subdirectory per page.
$UploadPrefix['Test.ABC'] = '/Test/ABC001';- Files attached to Test.ABC will be stored in subdirectory Test/ABC001.
$UploadPrefix['default'] = '/$Group/$Name';- All file attachments will be stored in Group/ Page/ subdirectories of the uploads directory (default is one subdirectory per group).
If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".
- File List - Tabulated filelist markup as alternative to
(:attachlist:), for a simple, easy readable look.