Try putting this is your cgi script:
#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); local $SIG{__WARN__} = \&Carp::cluck;
The most likely causes of file upload errors are (1) the upload directory is not mode 0777, or what is called World-Writable; and (2) you are trying to upload to the wrong location. You often need to check what is the absolute path to your upload directory on the server. Often these are aliased, but your server control panel should be able to say what the absolute pathname is to your home dir.

If you havn't discovered it on your own yet, try running this script to get your cgi info.

#!/usr/bin/perl # Don't buffer output $| = 1; # Ask for server name and information chomp($hostname = `hostname`); chomp($uname = `uname -a`); # Ask system for user name chomp($user = `/usr/bin/whoami`); # Ask system for user id and group id for this user ($uid, $gid) = (getpwnam($user))[2, 3]; # Get path for sendmail program chomp($sendmail = `which sendmail`); # # Generate the complete form # print "Content-type: text/html\n\n"; print qq( <html> <head> <title>CGI Environment</title> </head> <body bgcolor="white"> <b> Host name is $hostname.<br> CGI programs execute as user $user ($uid, $gid).<br> System description is $uname.<br> </b> <hr> <h2 align="center">CGI Environment</h2> <p> <br> SERVER_SOFTWARE = $ENV{'SERVER_SOFTWARE'}<br> SERVER_NAME = $ENV{'SERVER_NAME'}<br> GATEWAY_INTERFACE = $ENV{'GATEWAY_INTERFACE'}<br> SERVER_PROTOCOL = $ENV{'SERVER_PROTOCOL'}<br> SERVER_PORT = $ENV{'SERVER_PORT'}<br> REQUEST_METHOD = $ENV{'REQUEST_METHOD'}<br> HTTP_FROM = $ENV{'HTTP_FROM'}<br> HTTP_ACCEPT = $ENV{'HTTP_ACCEPT'}<br> HTTP_USER_AGENT = $ENV{'HTTP_USER_AGENT'}<br> HTTP_REFERER = $ENV{'HTTP_REFERER'}<br> PATH_INFO = $ENV{'PATH_INFO'}<br> PATH_TRANSLATED = $ENV{'PATH_TRANSLATED'}<br> SCRIPT_NAME = $ENV{'SCRIPT_NAME'}<br> QUERY_STRING = $ENV{'QUERY_STRING'}<br> REMOTE_HOST = $ENV{'REMOTE_HOST'}<br> REMOTE_ADDR = $ENV{'REMOTE_ADDR'}<br> REMOTE_USER = $ENV{'REMOTE_USER'}<br> REMOTE_IDENT = $ENV{'REMOTE_IDENT'}<br> AUTH_TYPE = $ENV{'AUTH_TYPE'}<br> CONTENT_TYPE = $ENV{'CONTENT_TYPE'}<br> CONTENT_LENGTH = $ENV{'CONTENT_LENGTH'}<br> <p> <hr> <p> <h2 align="center">Complete Environment</h2> ); foreach $key (sort keys %ENV) { print "$key = $ENV{$key}<br>\n"; } print qq( <h2 align="center">System Programs</h2> Sendmail program path : $sendmail </body> </html> );

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: CGI and security by zentara
in thread CGI and security by AnnShinoy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.