- Changed default behaviors for $c->model/$c->controller/$c->view
to more sane settings.
- added the clear_errors method - an alias for error(0)
+ - Added tmpdir option for uploads (Kei OHSHIRO)
+ - Applied patch from GEOFFR to allow normal filehandles.
5.66 2006-03-10 17:48:00
- Added Test::WWW::Mechanize::Catalyst support
sub finalize_body {
my ( $self, $c ) = @_;
- if ( ref $c->response->body && $c->response->body->can('read') ) {
- while ( !$c->response->body->eof() ) {
- $c->response->body->read( my $buffer, $CHUNKSIZE );
+ my $body = $c->response->body;
+ if ( ref $body && ($body->can('read') || ref($body) eq 'GLOB') ) {
+ while ( !eof $body ) {
+ read $body, my $buffer, $CHUNKSIZE;
last unless $self->write( $c, $buffer );
}
- $c->response->body->close();
+ close $body;
}
else {
- $self->write( $c, $c->response->body );
+ $self->write( $c, $body );
}
}
unless ( $c->request->{_body} ) {
$c->request->{_body} = HTTP::Body->new( $type, $self->read_length );
+ $c->request->{_body}->{tmpdir} = $c->config->{uploadtmp} if exists $c->config->{uploadtmp};
}
if ( $self->read_length > 0 ) {
$upload->tempname;
$upload->type;
+To specify where Catalyst should put the temporary files, set the 'uploadtmp'
+option in the Catalyst config. If unset, Catalyst will use the system temp dir.
+
+ __PACKAGE__->config( uploadtmp => '/path/to/tmpdir' );
+
See also L<Catalyst>.
=head1 DESCRIPTION