[horde] Add to download header

Jan Schneider jan at horde.org
Mon Oct 16 08:56:21 UTC 2017


Zitat von Mike Poznecki <poz_sa at yahoo.com>:

> Hi, how can I added a new tag to the header on a download file. (The  
> attachment)
> I have tried to add a new tag in services/download/index.phpI added  
> it like this:
> $browser->downloadHeaders(   isset($res['name']) ? $res['name'] :  
> $var->filename,   isset($res['type']) ? $res['type'] : null,
>    isset($res['newTag']) ? $res['newTag'] : "newTag",
>    false,   $res['size']);
>
> So I tried to add 'newTag'.  It does not error, but two things  
> happen.  1) the tag is not in the header. 2) the file no long tried  
> to download, but instead just spits out in the browser.
> Can someone help me do this?

What do you mean with "tag"? A custom HTTP header? This is not what  
downloadHeaders() is for:  
https://dev.horde.org/api/master/lib/Browser/class-Horde_Browser.html#_downloadHeaders

Instead just do a regular header() call before the downloadHeader()  
line: http://php.net/manual/en/function.header.php

-- 
Jan Schneider
The Horde Project
https://www.horde.org/



More information about the horde mailing list