On 31/03/2017 17:29, [email protected] 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
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to