Dear Sir,

I am getting form data values as null in %fdat varible in EmbPerl, if we
go for file upload and form property enctype="multipart/form-data".
Without enctype="multipart/form-data" and submit the form, can see the
form values in %fdat variable. Can anyone tell me why its giving undef in
the case of enctype

If we remove enctype="multipart/form-data" form property, can see the form
data (filename) after submiting the page.

includng enctype="multipart/form-data" in form will give undef filename.
Any idea?

Here is the EmbPerl code
if((defined $fdat{file} && $fdat{file}) && $fdat{upload}) {
$filename = "/tmp/sample.txt";
open (FILE, "> $filename") || die("open failed: $!");
while (read($fdat{file}, $buffer, 32768)) {
print FILE $buffer || die("print test: $!");
close FILE || die("close test: $!");

and HTML

<form action="load.html" name="form1" method="post"
<tr class="cell4">
<td>Select EXCEL rate sheet</td>
<td><input type="file" name="file" value=""></td>
<tr class="cell3">
<td><input type="submit" name="upload" value="upload"></td>

I couldn't any find solution from google. Could you please post this qn in
your site and provide solution?

I am using EmbPerl 2.3.0, CGI 3.55, Perl 5.10.1 and OS Linux

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupembperl @
categoriesmodperl, perl
postedNov 17, '11 at 6:13a
activeNov 17, '11 at 6:13a

1 user in discussion

Suresh Kumar: 1 post



site design / logo © 2022 Grokbase