[pmwiki-users] $UploadPrefixFmt and Attach files

Hans design5 at softflow.co.uk
Fri Apr 4 13:49:59 CDT 2008


Friday, April 4, 2008, 3:40:58 PM, Dominique Faure wrote:

> Then, couldn't we reuse the $UploadPrefixFmt array itself:

> # configuration init
> $UploadPrefixFmt['MyGroup.MyPage'] = '/storage/for_my_page';
> $UploadPrefixFmt['AnotherGroup.'] = '/another_storage/$Name';

> # core init
> $UploadPrefixFmt['$FullName'] = '/$Group';

> with the keys giving the naming scheme to use at upload, and the
> related values taken as a sole array defining a search path by itself.

This looks very promising!

It also solves an additional dilemma I discovered:

Using fox.php I can now upload files and post page content in one
submission. And the upload target page can be specified, as one may
want a file to be attached to a new page one is creating with the
form. With the existing definition of $UploadPrefixFmt I can set it
conditionally different for a group, but this group relates to the
current page and not necessarily to the upload target page I wish the
file to be attached to.

Having an array of special UploadPrefix groups or pages the upload
function can check if the target page is a key in this array, and set the
prefix accordingly to the array value.

I like to be able to upload/attach files to pages other than the
current page (which may just be an upload form page), so having a
means to check if the target needs a special upload prefix is
important.


  ~Hans




More information about the pmwiki-users mailing list