CGI-UploadEasy

 view release on metacpan or  search on metacpan

UploadEasy.pm  view on Meta::CPAN


    $CGI::POST_MAX = $self->{maxsize} * 1024;
    $CGI::DISABLE_UPLOADS = 0;
    $CGITempFile::TMPDIRECTORY = $self->{tempdir} if $self->{tempdir};
    $self->{cgi} = CGI->new;
    if ( my $status = $self->{cgi}->cgi_error ) {
        _error($self, $status, "Post too large: Maxsize $self->{maxsize} KiB exceeded.");
    }

    if ( $ENV{REQUEST_METHOD} eq 'POST' and $ENV{CONTENT_TYPE} !~ /^multipart\/form-data\b/i ) {
        _error($self, '400 Bad Request', 'The content-type at file uploads shall be '
         . "'multipart/form-data'.<br />\nMake sure that the 'FORM' tag includes the "
         . 'attribute: enctype=&quot;multipart/form-data&quot;');
    }

    $self->{files} = _upload($self);

    bless $self, $class;
}

=over 4



( run in 2.255 seconds using v1.01-cache-2.11-cpan-524268b4103 )