[pmwiki-users] Weird one for those that use the attachtable cookbook

Christopher Cox chriscox at endlessnow.com
Thu Oct 15 10:44:19 PDT 2026


On 10/15/26 4:32 AM, Petko Yotov wrote:
> I can't reproduce this.

To reproduce on a pmwiki with per page downloads defined by:

$UploadPrefixFmt = '/$Group/$Name';

You need markup on pages of the same Group name that produce artifacts into the 
uploads area.  That is a markup that produces 
uploads/Group/Name/blah-artifact.txt (for example).

So, in the case of my private recipe, I see the following in that directive:

    $dirpath =
         $FarmD . '/' .
         FmtPageName(
             $UploadFileFmt,
             $pagename
         );

And that is what is used for determining there the artifacts of the directive 
are placed.  So, when attachtable does whatever it does.... I'm seeing the 
directive get fired off as if each page of the Group is being processed, but the 
dirpath seemingly is for the page of the attachtable.  So viewing 
(:attachtable:) on Test/Name1 results in processing of directives on Test/* with 
all the dirpaths (above) being set to Test/Name1.

So, not sure why attachtable is activating all pages of the Group, and want to 
know how to prevent (or do correctly) the upload pathing in my recipe to work 
with the page where the markup actually lives rather than whatever attachtable 
is doing.


> 
> On a blank PmWiki 2.7.6, in config.php, I have enabled the latest Attachtable, 
> and have this for per-page uploads:
> 
>    $UploadPrefixFmt = '/$Group/$Name'; # enable per-page uploads
> 
> Note the single quotes.
> 
> In Site/UploadQuickReference I added (:attachtable:).
> 
> When I attach a file to Main.HomePage?action=upload, it is listed there.
> 
> When I attach a file to Main.WikiSandbox?action=upload, it is listed there. The 
> file attached to HomePage is not listed.
> 
> Adding more files to either page does not make them appear in the other page.
> 
> What happens if you revert to (:attachlist:) in UploadQuickReference?
> 
> If $UploadPrefixFmt is correctly set in config.php (not in Group.Page.php), I 
> suspect something else is interfering. See the first entry on the page 
> Troubleshooting on how to track it:
> 
>    https://www.pmwiki.org/wiki/PmWiki/Troubleshooting
> 
> Petko
> 




More information about the pmwiki-users mailing list