NAME
HTTP::Engine::Middleware::UploadTemp - temporary directory management at middleware layer
SYNOPSIS
my $mw = HTTP::Engine::Middleware->new;
$mw->install( 'HTTP::Engine::Middleware::UploadTemp' => {
keepalive => 0, # generate temporary directory to 1 request only
cleanup => 1, # CLEANUP option for File::Temp::tempdir
tmpdir => 1, # TMPDIR option for File::Temp::tempdir
base_dir => '/tmp', # DIR option for File::Temp::tempdir
template => 'FOO_XXXX', # template option for File::Temp::tempdir
lazy => 1, # lazy generate for temporary directory
});
HTTP::Engine->new(
interface => {
module => 'YourFavoriteInterfaceHere',
request_handler => $mw->handler( \&handler ),
}
)->run();
DESCRIPTION
This middleware add the management of temporary directory for upload files.
Another reason is that HTTP::Body::MultiPart does not clean up to temporary files.
AUTHOR
Kazuhiro Osawa
SEE ALSO
HTTP::Engine::Middleware, HTTP::Engine::Request, HTTP::Engine::Request::Upload