[Xitami] Folder permission issue or PERL error???
Ayhan Tuncer
xitami@lists.xitami.org
Fri, 14 Jan 2005 10:00:00 +0200
How is the wording of the error at line 62? Is it in the cgierr.log ?
Ayhan Tuncer
-----Original Message-----
From: xitami-admin@lists.xitami.org
[mailto:xitami-admin@lists.xitami.org] On Behalf Of Admin (MRJ)
Sent: Friday, January 14, 2005 9:11 AM
To: xitami@lists.xitami.org
Subject: [Xitami] Folder permission issue or PERL error???
I am having a bit of trouble here.
=20
I have ActivePerl 5.8.6 installed
Xitami 2.5c2 installed on Win 2k
=20
and I'm trying to get http://www.radinks.com/upload/
<http://www.radinks.com/upload/>=20
this little thing to work in the lite edition free version.
=20
Now everything is ok as long I try using the html-perl.htm file to do an
upload but=20
it fails stating there is a error on line 62 in the upload.cgi file.
=20
the following is the CGI file I am using.
=20
Any hints as to why it won't upload to my xitami box?
I really don't know any Perl myself to debug this thing in a proper
manner.
=20
Thanks for any help.
=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
=20
#!/usr/bin/perl -w
=20
#
# Perl script to accept file uploads. This script is provided for
demonstration=20
# purposes only.
# you need to have the CGI module installed.
#
# Copyright Rad Inks (pvt) 2003
# http://www.radinks.com
=20
use CGI; =20
use Carp;
=20
sub bye_bye {
$mes =3D shift;
print "<br>$mes<br>\n";
=20
exit;
}
=20
=20
=20
print "Content-type: text/html\n\n ";
my $cg =3D new CGI();
=20
#
# Files will not be saved if $save_path is left undefined. Please make
sure
# the path you choose is writable.
#
=20
my $save_path =3D "D:\\tmpUL\\";
=20
print <<__TABLE__;
<html>
<body bgcolor=3D"FFFFCC">
=20
<table border=3D"1" cellpadding=3D"5" width=3D"100%" align=3D"center">
<tr><td colspan=3D"2" bgcolor=3D"#0066cc"><font color=3D"#FFFFCC" =
size=3D"+1"
align=3D"center">Files Uploaded</font></td></tr>
<tr bgcolor=3D"#ffff00"><td style=3D"font-size: 110%;"><nobr>File
Name</nobr></td>
<td style=3D"font-size: 110%" align=3D"right"><nobr>File
size</nobr></td></tr>
__TABLE__
=20
my $size =3D $cg->param;
for($i=3D0 ; $i < $size ; $i++)
{
$file_upload =3D $cg->param("userfile[$i]");
=20
if($file_upload) {
my $fh =3D $cg->upload("userfile[$i]");
my @name =3D split('/',$fh);
my $filename =3D $name[$#name];
=20
$fsize =3D(-s $fh);
print "<tr><td>$filename </td>\n";
print "<td>$fsize</td></tr>";
=20
if(defined($save_path))
{
open (OUTFILE,">>$save_path/$filename");
while(<$fh>) {
print OUTFILE $_;
### THIS IS WHERE THE ERROR OCCURS
}
close(OUTFILE);
}
else
{
carp 'not saving';
}
}
}
=20
print <<__TABLE__;
</table>
=20
<p style=3D"text-align:center; font-size: 80%">Sample Perl Upload =
handler
provided by
<a href=3D"http://www.radinks.com/?dn">Rad Inks</a></p>
=20
<p style=3D"text-align:center; font-size: 80%">have you seen our <a
href=3D"http://www.radinks.com/sftp/?dn">Secure FTP Applet</a> or our
<a href=3D"http://www.radinks.com/mms/?dn">Multimedia Messaging
Solution</a>?</p>
=20
__TABLE__
=20
=20