[Catalyst] Detecting if a user aborted a (long) download

Thomas Klausner domm at cpan.org
Sun Mar 11 14:26:13 GMT 2007


Hi!

I need to figure out if a user aborted a longish download.  (some background:
Users can download a limited amount of mp3s. If the download doens't work for
some reason, they must not be "charged") 

In our old plain mod_perl 1.x handlers, I had something like:
    
    $r->send_fd($fh);

    if ($r->connection->aborted) {
        # do stuff if user aborted download
    }

Now, using Catalyst (on mod_perl 2.x), I'm doing this to send the file:

    $c->res->body( $fh );

But how do I figure out if the download was successfull? I didn't find anything in the docs (but a RTFM-answer is appreciated, if I missed the right piece of codocumentation).

Thanks!

-- 
#!/usr/bin/perl                               http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}



More information about the Catalyst mailing list