Mojo::Upload(3pm)

Mojo::Upload3pm

Upload

Usage

  use Mojo::Upload;
  my $upload = Mojo::Upload->new;
  say $upload->filename;
  $upload->move_to('/home/sri/foo.txt');

Overview

Mojo::Upload is a container for uploaded files.

Attributes

Mojo::Upload implements the following attributes.

asset

  my $asset = $upload->asset;
  $upload   = $upload->asset(Mojo::Asset::File->new);

Asset containing the uploaded data, usually a Mojo::Asset::File or Mojo::Asset::Memory object.

filename

  my $filename = $upload->filename;
  $upload      = $upload->filename('foo.txt');

Name of the uploaded file.

headers

  my $headers = $upload->headers;
  $upload     = $upload->headers(Mojo::Headers->new);

Headers for upload, usually a Mojo::Headers object.

name

  my $name = $upload->name;
  $upload  = $upload->name('foo');

Name of the upload.

Methods

Mojo::Upload inherits all methods from Mojo::Base and implements the following new ones.

move_to

  $upload = $upload->move_to('/home/sri/foo.txt');

Move uploaded data into a specific file.

size

  my $size = $upload->size;

Size of uploaded data in bytes.

slurp

  my $bytes = $upload->slurp;

Read all uploaded data at once.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 7 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13

From libmojolicious-perl 9.39+dfsg-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.