perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Chamas <>
Subject Re: Modifying HTTP Headers
Date Fri, 11 May 2001 01:32:15 GMT
Aaron Johnson wrote:
> Is there a way to modify the HTTP header content from within Apache::ASP.
> We are sending a file via a cgi script right now using modified headers.  We
> would like to do this under ASP since we don't have all the session data
> available via the cgi script.
> We do something like this:
>     print $q->header(
>         -content_type              => $file->MIME_Type,
>         -content_length            => $file->Size,
>         -content_transfer_encoding =>
>             $file->MIME_Type =~ m/^text/ ? 'base64' : 'binary',
>         -content_disposition       =>
>             qq[inline; filename="].$file->File_Name .qq["],
>     );

Well, you can try using your CGI object, I once tried to make
things fairly compatible with  Just wrap <% %> around
your CGI code and go!

But the real ASP method lies in the $Response object:

content-type with:
$Response->{ContentType} = "text/html" 

the rest with:
$Response->AddHeader($name, $value)

but you will have to know the real header names like
Content-Disposition, Content-Length, etc.

Also, content length will be calculated for you if 
buffering is on, $Response->{Buffer} = 1, and no flush
is called prior to the end of the script.


Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA                1-714-625-4051

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message