You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Daniel Baker <db...@sc.com> on 2007/03/20 00:42:19 UTC

Re: manipulating http headers with rivet

This command will allow your users' browsers to do estimated download  
times:

         headers set "Content-Length" [file size $fileName]

FWIW, my implementations of Content-Disposition have the filename  
included inside filename="filenamehere.xyz" rather than just having  
the filename as the value of the Content-Disposition field

On Feb 25, 2007, at 5:02 AM, Massimo Manghi wrote:

> Quoting David Welton <da...@gmail.com>:
>
>> Things should work more or less like this: the first 'puts' triggers
>> header sending.  So if you're doing templates or anything like that,
>> that might be a place to look.
>>
> Of course I'm doing templates, but before I can put my code
> in the template structure I wish I had a simple working piece
> of code.
>
> Do you mean that placing a "puts" in the right place might
> get the headers sent at the right time? I tested apache
> on this script
>
>         headers type "application/pdf"
>         headers set content-disposition "PPP.pdf"
>
>         set poster [open Poster.pdf r]
>         fconfigure $poster -translation binary
>         set pdf    [read $poster]
>         close $poster
>         puts $pdf
>
> strace output shows the calls on "write" with the headers
> as buffers, but the browsers didn't notice it. I'm
> trying to dump the whole session tonight
>
> -- Massimo Manghi
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> ----------------------------------------------------------------
> Imp3 - Webmail del Dipartimento di Biologia Evolutiva e Funzionale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: manipulating http headers with rivet

Posted by Massimo Manghi <ma...@biol.unipr.it>.
Daniel Baker wrote:

> This command will allow your users' browsers to do estimated download  
> times:
>
>         headers set "Content-Length" [file size $fileName]
>
> FWIW, my implementations of Content-Disposition have the filename  
> included inside filename="filenamehere.xyz" rather than just having  
> the filename as the value of the Content-Disposition field
>
    Thank you Daniel, I had fixed the 'Content-Disposition' issue after 
I found a
working example in a PHP programming manual (and it wasn't an easy job
to find a manual that cleanly explains the headers programming). The
'Content-Length' header was already ok.

Yesterday I started to work on a page to be included in the documentation
that recaps the experience I made.

-- 
-- Massimo Manghi 

-- Dipartimento di Biologia Evolutiva e Funzionale
-- Università degli Studi di Parma
-- Parco Area delle Scienze 11A - 43100 Parma


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org