perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Watanabe <>
Subject Re: question on multipart forms and %fdat
Date Fri, 10 Jan 2003 14:53:15 GMT

>Embperls handles file uploads trough this way when you use
>"multipart" forms the file fields are converted in file handles.
>In the code bellow it seems that your are reading from the wrong
>variable in your object:

actually the thing is that the way my controller handles things, it doesn't 
even make the upload call (because it relies on hidden fields that tells 
other objects what to instantiate).  The main problem i'm seeing is that 
%fdat only returns " name" and " filename" keys back.  If I have more than 
one form field say hidden fields and text fields, those aren't 
returned.  Here's an example form i wrote up:

<form method="post" enctype="multipart/form-data">
<input type="file" name="image">
<input type="text" name="junk1">
<input type="hidden" name="junk2" value="garbage">
<input type="hidden" name="junk3" value="garbage">
<input type="submit" name="act" value="submit">
fdat: [+ %fdat +]<br>
[$ foreach $item keys %fdat $]
<li>item: "[+ $item +]" is "[+ $fdat{$item} +]"<br>
[$ endforeach $]

When I attempt to iterate through %fdat, here's the type of output i receive:

fdat: 2/8
item: " name" is ""image""
item: " filename" is ""02071908max_NK116718_b.jpg" Content-Type: image/jpeg 

(where 02071908max_NK116718_b.jpg is the file upload I'm trying to deal 
with).  What I want to know is what happens to my other form info like 
junk1, junk2, and junk3?  When I remove the method="post" part, all of the 
fields are displayed correctly.  the expected output should've at least 
included the hidden and text fields in addition to the file.  i'm not 
really sure what to make of this.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message