For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > August 2005 > No data from form when using enctype="multipart/form-data"









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author No data from form when using enctype="multipart/form-data"
annette_bunz@gmx.de

2005-08-26, 7:55 am

Hello,

I'm new to Perl (exactly I know nothing of it) and I have to change an
existing Perl script that sends data, filled into an HTML form, via
Email. Now the user should ba able to upload a file, which should be
sent with the Email as an attachment.

Now I tried and I am able to send a file from the server as an
attachment. But I am not able to load a file from the client to the
server.

I found some sites in the internet and they all say, that I have to put
enctype="multipart/form-data" into the form tag. When I change nothing
of the running script and only put enctype="multipart/form-data" into
the form tag the script does not work any more, because it get's no
data from the form.

The script gets the data by the post method and the perl code
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

I also tried it with the following:

use CGI;
my $input = new CGI;
@names = $input->param;
my $test;
print header, start_html;
foreach $name (@names){
$test = $input->param('$name');
print ("$name: $test<br/>\n");
}
print end_html;

But I also get no data.

Can anyone help me please?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com