26.09.2008 00:20 [EMAIL PROTECTED]:

Tomas Doran <[EMAIL PROTECTED]> wrote on 09/25/2008 04:04:58 PM:


On 25 Sep 2008, at 19:35, Christian Lackas wrote:

   print CGI::header(...);
   $ZIP->writeToFileHandle(*STDOUT);
   for my $f (@files) {
       $ZIP->addFile($f, basename($f));
   }

How can I achieve something similar under Catalyst?

Looking at the source code for Catalyst::write, and
Catalyst::Engine::write, you need to say $c->finalize_headers, after
which just writing to STDOUT as above should do the right thing..

However, I'd have thought that clients on the other end would be
somewhat unhappy with not getting a Content-Length header...

The only two consequences I know of for not including the content length is that the download bar for the transfer lists unknown in browsers, and if
the transfer fails midway the browser does not "know".

Things will go wrong, they always do.
Not following the RFC is a very bad idea, without a content-length header the client could react completely random.

The right way to do it would be a response with chunked transfer encoding.

--
sebastian

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to