I tried to upload a externel file to the server.
firts i build a new sub in html.pl and i create a link to start the sub (that works)
sub upload {
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
print qq|
<html>
<head>
<title>Neue Seite 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<form name="Upload" action="$db_script_link_url&data=1" method="POST"
enctype="multipart/form-data">
<p><input type="file" name="Datei"></p>
<p><input type="submit" value="Upload starten"> </p>
</form>
</body>
</html>
|;
}
after I klick on the Link the form is diplayed where i can browse for the file i want to upload to the server.
Now I made a sub in db.cgi to get the data from the form:
sub data {
binmode STDIN;
read STDIN, $Daten, $ENV{'CONTENT_LENGTH'};
@Teile = split /-----------------------------.{9}/, $Daten;
@Datei = split /\n/, $Teile[1], 5;
while ($Datei[1] =~ /\\/) { $Datei[1] =~ s/^.*\\//; }
$Datei[1] =~ s/"//;
chop $Datei[1];
chop $Datei[4]; chop $Datei[4];
@DATEN = split (/##/, $Datei[4]);
}
$DATEN[4] now contains the text of the File
after that i will split the text and do some other things with the text but that is not the problem
After i klick the submit button in the form DBman dispay the Login screen. ???????
what is the problem
perhaps the action tag in the form is not right?
Sorry for my bad english
Lorenzo
firts i build a new sub in html.pl and i create a link to start the sub (that works)
sub upload {
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
print qq|
<html>
<head>
<title>Neue Seite 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body>
<form name="Upload" action="$db_script_link_url&data=1" method="POST"
enctype="multipart/form-data">
<p><input type="file" name="Datei"></p>
<p><input type="submit" value="Upload starten"> </p>
</form>
</body>
</html>
|;
}
after I klick on the Link the form is diplayed where i can browse for the file i want to upload to the server.
Now I made a sub in db.cgi to get the data from the form:
sub data {
binmode STDIN;
read STDIN, $Daten, $ENV{'CONTENT_LENGTH'};
@Teile = split /-----------------------------.{9}/, $Daten;
@Datei = split /\n/, $Teile[1], 5;
while ($Datei[1] =~ /\\/) { $Datei[1] =~ s/^.*\\//; }
$Datei[1] =~ s/"//;
chop $Datei[1];
chop $Datei[4]; chop $Datei[4];
@DATEN = split (/##/, $Datei[4]);
}
$DATEN[4] now contains the text of the File
after that i will split the text and do some other things with the text but that is not the problem
After i klick the submit button in the form DBman dispay the Login screen. ???????
what is the problem
perhaps the action tag in the form is not right?
Sorry for my bad english
Lorenzo