Gossamer Forum
Home : General : Perl Programming :

problem with uploading files - urgent help needed

Quote Reply
problem with uploading files - urgent help needed
hi everybody i am a newby to perl, i am hosting a little portal that offers 10Mb webhosting. I am using a perl script for registering, auth, and managing personal folders and files. Everything' s ok until one wants to upload images or zips or some other files that are not txt heml ini and log.
You can try see what i mean by going to :
http://keropinet.dyndns.org/cgi-bin/account/signup.cgi
and after signing up go to:
http://keropinet.dyndns.org/cgi-bin/account/manager.cgi

then try to upload an image or something...

the code portion that handles the upload is the following, i cannot say if there is something wrong in there...
# Upload file(s)
if ($in{'upload'}) {
for ($i=1; $i<=5; $i++) {
if ($in{"file$i"}) {
if ($cgi_cfn{"file$i"} =~ /(.*)\/(.*)/) { $cgi_cfn{"file$i"}=$2; }
if ($cgi_cfn{"file$i"} =~ /(.*)\\(.*)/) { $cgi_cfn{"file$i"}=$2; }

foreach $line (@bad_types) { if ($cgi_cfn{"file$i"} =~ /$line/) { &error_html("Invaild file type: $line"); } }
$limit=$available;
if (-f "$config{'root_dir'}/$in{'username'}/$cgi_cfn{\"file$i\"}") {
@stat=stat("$config{'root_dir'}/$in{'username'}/$cgi_cfn{\"file$i\"}");
$limit += ($stat[7] * .001);
}
if (($limit - (length($in{"file$i"}) * .001)) < 0) { &error_html("Spazio web esaurito"); }
open (FILE,">$config{'root_dir'}/$in{'username'}/$cgi_cfn{\"file$i\"}") || &error_html("Impossibile creare $cgi_cfn{\"file$i\"}: $!");
binmode (FILE);
print FILE $in{"file$i"};
close (FILE);
}
}

I forgot to say... when i try to upload images, the browser stands by in 'sending connection to host....'
and nothing happens
<img src="http://keropinet.dyndns.org/knlogo_002.jpg">
<br> <b>keropiNET</b> servizi online
Subject Author Views Date
Thread problem with uploading files - urgent help needed keropinet 5818 May 20, 2004, 10:15 PM
Thread Re: [keropinet] problem with uploading files - urgent help needed
tandat 5661 May 22, 2004, 8:49 AM
Thread Re: [tandat] problem with uploading files - urgent help needed
keropinet 5665 May 22, 2004, 5:34 PM
Thread Re: [keropinet] problem with uploading files - urgent help needed
tandat 5625 May 22, 2004, 7:31 PM
Post Re: [tandat] problem with uploading files - urgent help needed
keropinet 5603 May 23, 2004, 3:11 AM