[horde] Add to download header

Mike Poznecki poz_sa at yahoo.com
Mon Oct 16 12:03:03 UTC 2017


 

    On Monday, October 16, 2017, 3:56:33 AM CDT, Jan Schneider <jan at horde.org> wrote:  
 
 
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/

-- 
Horde mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: horde-unsubscribe at lists.horde.org


Hi, and thanks.  When the user clicks to download an attachment, I want to add a tag to the header of that attachment.Right now some of the header tags in the file are:Cache-Control:Content-Disposition:Content-Length:Content-Type:X-Powered-By:etc....

as a test I would like to add:newTag:
Thanks for your help on this.





  


More information about the horde mailing list