perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Watanabe <keith.watan...@g3s.com>
Subject question on multipart forms and %fdat
Date Thu, 09 Jan 2003 07:29:37 GMT
i think this issue was discussed in the past, but i really didn't see a 
resolution in the mail archives so i might be covering grounds 
again.  still i want to work through this problem with anyone else who 
encountered it and see what they did to solve it (if at all possible).

Here's the issue.  Currently i have a form where i'm using the 
method="post" and enctype="multipart/form-data" part of a form for 
uploading an image file.  when I use post in the form, my %fdat variable 
produces something like (in going through my error logs):


[Mon Jan  6 22:17:49 2003] [warn] [7054]ERR:  32:  Warning in Perl code: q 
:  name is "upload" at 
/home/jadmin/projects/joshi/perl/lib/Handler/Controller.pm line 25.
[Mon Jan  6 22:17:49 2003] [warn] [7054]ERR:  32:  Warning in Perl code: q 
:  filename is "fl.jpg"
Content-Type: image/jpeg

ÿØÿà at /home/jadmin/projects/joshi/perl/lib/Handler/Controller.pm line 25.

(Note: I'm using a model-view-controller type of design pattern, so I'm 
passing in %fdat and printing out warning messages in my controller module 
to examine the contents)

Here, upload is supposed to be the key value and I'm assuming that the 
funky looking characters are the binary file that corresponds to "upload". 
filename apparently is the name of the file i'm trying to upload.

Now, if I remove the method="post" portion in the form, I don't see these 
warnings, instead seeing the normal key/value pairs from the form (I have a 
few more fields in my form that I'm using to store information of the file 
into a database).  However, by removing the "post" part, I can't get the 
form to upload the image file properly, so I assume that the post part is 
necessary.

Anyway, what I'm wondering is how/why having the "post" portion mangles the 
variables in my form when i use embperl in a multipart type of form.  I 
tried this through a cgi script which wrote the file fine.  When I say, do 
a "use CGI" and attempt to retrieve the form values through my CGI object, 
my values are still mangled in the embperl page.  Also i tried hacking the 
Embperl.pm module where I attempted to print the contents from the @ffld 
array into my log file, but the @ffld array was of size 0.

Currently, my setup is Apache 1.3.26 on a Redhat 8.0 linux box, using 
Embperl 1.3.5 and CGI.pm v 2.86, mod perl 1.26 and perl 5.8.  i tried 
varying the embperl version using 1.3.4 and 1.3.1, but the same results 
occurred there.

thanks!

-keith 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message