Skip to content

Catalyst::Request::Upload - add a move_to method #200

Description

@tomredsky

Request::Upload uses File::Copy to copy the file. File::Copy also provides a move function.

Rationale
When uploading files, it adds to the response time if we have to then copy the same number of bytes from uploadtmp to somewhere else on the file-system. In most cases moving a file is atomic and very fast.

sub move_to {
    my $self = shift;
    return File::Copy::move( $self->tempname, @_ );
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions