ASP4
view release on metacpan or search on metacpan
lib/ASP4/Request.pm view on Meta::CPAN
ContentDisposition => $upInfo->{'Content-Disposition'},
);
}
else
{
no warnings 'uninitialized';
%info = (
ContentType => $s->context->cgi->{uploads}->{ $field }->{headers}->{'Content-Type'},
FileHandle => $ifh,
FileName => $s->context->cgi->{uploads}->{ $field }->{filename},
ContentDisposition => 'attachment',
);
}# end if()
require ASP4::FileUpload;
return ASP4::FileUpload->new( %info );
}# end FileUpload()
sub Reroute
{
lib/ASP4/StaticHandler.pm view on Meta::CPAN
css => 'text/css',
pdf => 'application/x-pdf',
js => 'text/javascript',
svg => 'image/svg+xml',
html => 'text/html',
);
my $type = $types{lc($ext)} || 'application/octet-stream';
$Response->ContentType( $type );
my ($filename) = $file =~ m{([^/]+)$};
my $disp = lc($type) eq 'pdf' ? 'attachment' : 'inline';
$Response->SetHeader('content-disposition' => qq($disp; filename="$filename"; yay=yay;));
$Response->Write( scalar(<$ifh>) );
close($ifh);
}# end run()
1;# return true:
( run in 1.663 second using v1.01-cache-2.11-cpan-88abd93f124 )