[ Please reply to the beginners list - I don't answer questions privately. ]

Prasath wrote (to me privately):
I am new in perl, i have to find the type and size of the uploaded file in perl. Send me the syntax to find

With CGI::UploadEasy you can do:

    use CGI::UploadEasy;
    my $ue = CGI::UploadEasy->new(-uploaddir => '/path/to/upload/dir');
    my $info = $ue->fileinfo;
    my $cgi = $ue->cgiobject;
    print $cgi->header('text/plain');
    foreach my $file ( keys %$info ) {
        print "File name: $file\n",
              "\tMIME type: $info->{$file}{mimetype}\n",
              "\tSize: $info->{$file}{bytes}\n\n";
    }

Please see http://search.cpan.org/perldoc?CGI::UploadEasy for further guidance.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to