Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
HTTP::Engine::MiddlewaUserUContributed)HTTP::Engine::Middleware::UploadTemp(3)

NAME
       HTTP::Engine::Middleware::UploadTemp - Deprecated. Please use
       $req->builder_options->{upload_tmp}

SYNOPSIS
       please use HTTP::Engine::Request's builder_options.

   example
	 sub your_handler {
	     my	$req = shift;
	     $req->builder_options->{upload_tmp} = File::Temp->newdir;
	     my	$file =	$req->upload('file');
	     ...
	 }

       any options for File::Temp

	 sub your_handler {
	     my	$req = shift;
	     $req->builder_options->{upload_tmp} = File::Temp->newdir(
		 'FOO_XXXX',
		 DIR =>	'/tmp',
	     );
	     my	$file =	$req->upload('file');
	     ...
	 }

       see File::Temp

   like	lazy option
	 sub your_handler {
	     my	$req = shift;
	     $req->builder_options->{upload_tmp} = sub { File::Temp->newdir };
	     my	$file =	$req->upload('file');
	     ...
	 }

   like	keepalive option
	 my $cache;
	 sub your_handler {
	     my	$req = shift;
	     $cache ||=	File::Temp->newdir;
	     $req->builder_options->{upload_tmp} = $cache;
	     my	$file =	$req->upload('file');
	     ...
	 }

   OLD 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::Request, File::Temp

perl v5.32.0			  2010-HTTP::Engine::Middleware::UploadTemp(3)

NAME | SYNOPSIS | DESCRIPTION | AUTHOR | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=HTTP::Engine::Middleware::UploadTemp&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help