Home  |  Linux  | Mysql  | PHP  | XML
From:Gunnar Hjalmarsson Date:Sun Jan 13 12:45:20 2008
Subject:Re: uploading a file with perl
Mike Williams wrote:
> On Jan 12, 2008 9:33 PM, Sean Davis wrote:
>> You should probably be using CGI.pm.  It will vastly simplify what you are
>> doing.  Then, you can read any of a dozen sites on doing file uploads using
>> CGI; see search.cpan.org for the details of using CGI.pm.
> 
> I agree with Sean.  You have 'use CGI' in your code, but you don't
> actually use it, you really should.

Or use CGI::UploadEasy, which is a wrapper around the upload 
functionality of CGI.pm.

> Notice that the upload code using CGI is about one third the length of
> your non-working code.
> There should be more error checking added, but it is up and limping.
> 
> You should look at the perldoc for CGI.   In particular search for MAX
> (with /MAX) and read the section about settint the maximum size of
> uploads.

All that would be taken care of by CGI::UploadEasy. And significantly 
less code - see http://search.cpan.org/perldoc?CGI::UploadEasy#EXAMPLE

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Navigate in group perl.beginners.cgi at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants