[pmwiki-devel] EnableDirectDownload

Simon nzskiwi at gmail.com
Mon Dec 1 11:30:02 PST 2025


Wow, awesome, that works so much better than my piece of code (which did
not actually work).
thanks very much.

On Mon, 1 Dec 2025 at 21:05, Petko Yotov <5ko at 5ko.fr> wrote:

> Indeed, there is:
>
> # Attach:file.jpg
> $url = DownloadUrl($pagename, "file.jpg");
>
>
> # Attach:Main.HomePage/file.jpg
> $url = DownloadUrl($pagename, "Main.HomePage/file.jpg");
>
> This function sets some other useful variables about the file in the
> global $FmtV which you can read immediately after the call, see
> upload.php.
>
> Petko
>
> --
> If you upgrade :  https://www.pmwiki.org/Upgrades
>
> On 01/12/2025 08:52, Simon wrote:
> > Is there a variable or helper for this
> >
> >    if (empty($EnableDirectDownload)) {
> > $url = PHSC("$ScriptUrl?n=$$fileNameFull&action=download"); # Direct
> > download disabled, route through pmwiki.php
> > } else {
> > $url = PHSC("$UploadUrlFmt/$fileNameFull"); #Direct download enabled
> > }
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20251202/a48118fe/attachment.html>


More information about the pmwiki-devel mailing list