in reply to Re^4: Upoading file using perl
in thread Upoading file using perl

If you post your cgi code (i think you did) and your form code. I'll try it out on another server under apache.

Replies are listed 'Best First'.
Re^6: Upoading file using perl
by rustybar (Novice) on Feb 10, 2009 at 12:33 UTC

    Hi, my web page for the user to upload the code is as below:

    #!/usr/bin/perl -w use CGI qw/:standard/; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use CGI::Session ( '-ip_match' ); my $session = CGI::Session->load(); #my $sid = $cgi->cookie("CGISESSID") || undef; #my $session = new CGI::Session(undef, $sid, {Directory=>'/tmp'}); if($session->is_empty){ print redirect('index.cgi'); } elsif($session->is_expired){ print redirect('index.cgi?status=expired'); } else{ print "Content-type: text/html\n\n"; print <<EOD; <html> <head> <title>NTU Earth Observatory Station</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +"> <link rel="stylesheet" href="/css/styles.css" type="text/css"> </head> <body bgcolor="#999999" leftmargin="0" topmargin="0" marginwidth="0" m +arginheight="0"> <form name="frmHome" method="POST" action="upload.cgi" enctype="multip +art/form-data"> <table width="780" cellspacing="0" cellpadding="0" border="0" align="c +enter"> <tr> <td height="100"> <img src="../imgs/banner.jpg" width="100%" height="100%"></td> </tr> </table> <table width="780" cellspacing="0" cellpadding="0" border="0" align="c +enter"> <tr> <td bgcolor="#CCCCCC" height="250" valign="top" width="160"> <table width="160" cellspacing="0" cellpadding="8" border="0"> </table> </td> <td bgcolor="#eeeeee" height="250" valign="top"> <table width="610" cellspacing="10" cellpadding="0" align="cente +r" border="0"> <tr> <td valign="top" class="text"> <div><p>File to Upload: <input type="file" name="file" / +></p></div> <div align="right"><p><input type="submit" name="submit" + value="Submit" /></p></div> </td> </tr> </table> </td> </tr> </table> <table width="780" cellspacing="0" cellpadding="0" height="40" border= +"0" align="center"> </table> </form> </body> </html> EOD }

    Thanks a lot!

Re^6: Upoading file using perl
by rustybar (Novice) on Feb 12, 2009 at 05:54 UTC

    I would like to find out, has anyone tried the codes yet. Are they working in apache server or is there anything wrong with my codes. Cos I just can't to get it running in the monkey web server. I'm running in an embedded environment, thus is trying a light weight server

    Would appreciate if anyone would show me some light. Thanks!