[pmwiki-users] Direct me to a Cookbook that uses markup that takes an uploaded attachment as a parm
Petko Yotov
5ko at 5ko.fr
Mon Sep 4 05:06:03 CDT 2017
On 2017-09-04 11:16, Simon wrote:
> Is it possible for a recipe to call the function LinkUpload directly?
Yes, if/when scripts/upload.php is included.
Petko
> On 3 April 2017 at 06:10, Petko Yotov <5ko at free.fr> wrote:
>
>> On 31/03/2017 17:29, ccox at endlessnow.com wrote:
>>
>>> I wanting to do something in a recipe in php that takes in an
>>> argument
>>> of Attachment or Group/Attachment or Group/Page/Attachment
>>>
>>> In particular needs to support the latter (down to uploads per
>>> page). I just want to make sure I code it "right".
>>>
>>
>> There are cookbook recipes but wouldn't you rather study from the
>> original?
>>
>> The scripts/upload.php file has the function LinkUpload().
>>
>> Its $path argument contains File.ext or Group/File.ext or
>> Group/Page/File.ext or even Group.Page/File.ext.
>>
>> Look how $pagename is derived from that, and $filepath becomes the
>> actual
>> path to the disk file if you need to manipulate it. At the end, $path
>> becomes the URL to the file that will be sent to the browser.
>>
>> Petko
More information about the pmwiki-users
mailing list