Ivan Ratnikov > HTTP-Server-EV-0.66 > HTTP::Server::EV::MultipartFile

Download:
HTTP-Server-EV-0.66.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Module Version: 0.65   Source   Latest Release: HTTP-Server-EV-0.68

NAME ^

HTTP::Server::EV::MultipartFile - represents file received by HTTP::Server::EV

FILE PARAMETERS ^

$file->size or $file->{size}

Filesize in bytes

$file->name or $file->{name}

Filename received in http request

METHODS ^

$file->fh ( sub { $handle = $_[0] or die 'can`t open file' });

Returns filehandle opened to reading. Callback is optional

$file->save($path, sub { $_[0] or die 'save failed' } );

Save received file to $path. Just moves file from tmp dir to $path if possible. Callback is optional

MultipartFile IMPLEMENTATIONS, BLOCKING AND CALLBACKS ^

If callback specified it will always called after IO completion no matter what HTTP::Server::IO implementation used.

If you use HTTP::Server::EV::IO::AIO then only way to know ->save status is specify callback, because ->save call will return immediately and set saving to background. You can`t use ->fh without callback.

If you use HTTP::Server::EV::IO::Blocking then all IO operations will block program. You can use methods withouth a callbacks.

If you use Coro then HTTP::Server::EV::IO::AIO will act as HTTP::Server::EV::IO::Blocking and block current Coro thread if no callback specified, or return immediately and call callback if it specified.

syntax highlighting: