Gossamer Forum
Home : Products : DBMan : Discussions :

Upload a external file

Quote Reply
Upload a external file
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|

<title>Neue Seite 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">


<form name="Upload" action="$db_script_link_url&data=1" method="POST"
<p><input type="file" name="Datei"></p>
<p><input type="submit" value="Upload starten"> </p>

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;

@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


Quote Reply
Re: Upload a external file In reply to

Could you please check out the following thread and see if the solution there will help you solve this:

HELP: garbaged uploaded file
ztin July 26, 1999
Thread reference: http://gossamer-threads.com/p/000583.html

Hope this helps, if not, perhaps you may need to display the top of your form for us to see.

Unoffical DBMan FAQ