<div dir="ltr">Wow, awesome, that works so much better than my piece of code (which did not actually work).<br>thanks very much.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, 1 Dec 2025 at 21:05, Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Indeed, there is:<br>
<br>
# Attach:file.jpg<br>
$url = DownloadUrl($pagename, "file.jpg");<br>
<br>
<br>
# Attach:Main.HomePage/file.jpg<br>
$url = DownloadUrl($pagename, "Main.HomePage/file.jpg");<br>
<br>
This function sets some other useful variables about the file in the <br>
global $FmtV which you can read immediately after the call, see <br>
upload.php.<br>
<br>
Petko<br>
<br>
-- <br>
If you upgrade : <a href="https://www.pmwiki.org/Upgrades" rel="noreferrer" target="_blank">https://www.pmwiki.org/Upgrades</a><br>
<br>
On 01/12/2025 08:52, Simon wrote:<br>
> Is there a variable or helper for this<br>
> <br>
> if (empty($EnableDirectDownload)) {<br>
> $url = PHSC("$ScriptUrl?n=$$fileNameFull&action=download"); # Direct<br>
> download disabled, route through pmwiki.php<br>
> } else {<br>
> $url = PHSC("$UploadUrlFmt/$fileNameFull"); #Direct download enabled<br>
> }<br>
> <br>
</blockquote></div>