Just to re-iterate a previous post.  Here is what I have done thusfar.

My httpd.conf file:
#
# **********************
# ** MOD PERL CHANGES **
# **********************
# limit POSTS so that they get processed properly
<Limit POST>
  PerlInitHandler POST2GET
</Limit>
# force reloading of modules on restart
PerlFreshRestart on
# Perl module primitive mother load on start/restart
#PerlRequire lib/perl/startup.pl
# FLOE application (mod_perl)
PerlModule Apache::DBI
PerlModule floeApp
<Location /floeApp>
  SetHandler perl-script
  PerlHandler floeApp
  PerlSendHeader On
</Location>

And the relevant two snippets of code from the script are:
        ## process incoming
        # if submitted
        my %hash = undef;
        my $initialList = $q->param('initialList') || '';
        my $upload = $q->upload || undef;
        my $fh = $upload->fh if defined($upload);
        if (defined($upload) && $upload) {
                $initialList = '';
                while (<$fh>) {
                        $initialList .= $_;
                }
        }

        ## some processing is done to the POST'ed data
        ## and eventually. . .

        ## send file to client
        print   "Content-type: text/plain\n";
                print   "Content-Disposition: attachment;
filename=list.txt\n\n";

        foreach my $value (sort keys %$hash) {
                chomp($value);
                next unless ($value);
                print "$hash->{$value}$CRLF$value$CRLF";
        }

        exit;

$q is the Apache::Request object.  When running in CGI mode it is simply
pointing toward the CGI.pm object.

I did not mean to presume Apache was doing anything to anything.
Apache::Request does not seem to appear to support/handle multipart in my
present config.  I do not know why.  All I have changed in my code is to use
Apache::Request instead of CGI.   Otherwise, the scripts are untouched.
Same machine, same httpd.conf other the mod_perl changes, same scripts. . .
.then why cannot I not see anything being passed via multipart/form-data
encoding?

   :  -----Original Message-----
   :  From: Issac Goldstand [mailto:[EMAIL PROTECTED]]
   :  Sent: Monday, March 18, 2002 9:37 AM
   :  To: Vuillemot, Ward W
   :  Cc: [EMAIL PROTECTED]
   :  Subject: Re: mod_perl does not see multipart POSTs
   :  
   :  
   :  I'm not sure I understand what you're asking...  Apache, 
   :  on it's own, 
   :  does not support any internal parsing of POST data, multipart or 
   :  otherwise, so why should mod_perl?  For this, we have the 
   :  Apache::Request library in mod_perl (Which is the 
   :  mod_perl interface to 
   :  the libapreq library for Apache's C API).  libapreq supports 
   :  multipart/form-data, even without a file upload...
   :  
   :   Issac
   :  
   :  Vuillemot, Ward W wrote:
   :  
   :  >All,
   :  >
   :  >I am still trying to figure out why my setup of mod_perl 
   :  does not have
   :  >multipart POSTs.  I rebooted my machine, and found that, 
   :  whereas I reported
   :  >before mod_perl would try to reload the page (which it 
   :  should not but send
   :  >out a text/plain attachment for download), it appears 
   :  the script (running as
   :  >a perl handler) does not see any of the multipart POST.  
   :  Vanilla posts are
   :  >not a problem, though.  Even if the information being 
   :  sent via multipart is
   :  >_not_ a file to upload to the server, the information is 
   :  lost in transit.
   :  >
   :  >Here is what is odd.  
   :  >
   :  >The same scripts/modules unmodified and running as 
   :  perl_cgi are okay.
   :  >Multipart forms allow me to upload files, et cetera.  In 
   :  short, I am
   :  >confident the problem is not with my programming.
   :  >
   :  >I am using the code snippet, POST2GET, to capture the 
   :  one-time read of POST
   :  >and storing as if it was retrieved via GET.
   :  >
   :  >Any ideas how to debug this?
   :  >
   :  >I REALLY REALLY would love some feedback.  I would love 
   :  to think that all my
   :  >effort to stay away from M$ ASP are worth it -- esp. 
   :  when I stand up to
   :  >defend Perl, Apache, and mod_perl in an environment that 
   :  is decidely
   :  >M$-bent.
   :  >
   :  >Thanks!
   :  >Ward
   :  >
   :  
   :  
   :  

Reply via email to