Click to See Complete Forum and Search --> : form-data: read with cgi


mc_hammer
08-23-2006, 11:03 AM
Hi there,

I've got something like


<form enctype="multipart/form-data" action="/cgi-bin/upload.cgi?sid=1542" method="post">
<input type="file" name="file">
...
</form>


in the CGI, I try to get the data from the form-fields like
read(STDIN, my $data, $ENV{'CONTENT_LENGTH'});
but $data remains empty.

but the data I provide in the url I can read like that

@qstring=split(/&/,$ENV{'QUERY_STRING'});

which works fine (@string got some data) - where migth I do the mistake?

oliver

rigadon
08-30-2006, 05:48 AM
I think you need to define $data OUTSIDE the brackets:

my $data;
read(STDIN, $data, $ENV{'CONTENT_LENGTH'});