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 <5...@free.fr> wrote:

On 31/03/2017 17:29, c...@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

_______________________________________________
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to