Completing more my question:

---------------------------
PerlTransHandler +Blogum::BlogumURI
---------------------------
in httpd.conf


The html form, printed by javascript
---------------------------
..
var form_e = document.createElement('form');
form_e.setAttribute('ENCTYPE','multipart/form-data');
..
with several inputs (hidden, text and one "file")
---------------------------



The submit action is catched by BlogumURI.pm
---------------------------
..
} elsif ($uri =~ /$cri_newArticle/) { # URI is recognised
   my $url;
   Blogum::NewsArticle -> new_article($r,\$url);
   $uri = $1.$url;
   $redirected++;
   $apache->err_headers_out->{'Location'} = "$uri";
   }
..
$r->filename($r->document_root . $r->uri);
if ($redirected) {return Apache::HTTP_MOVED_TEMPORARILY;}
else  {return Apache::DECLINED;}
---------------------------


NewsArticle.pm "new_article" method calls News.pm that calls
---------------------------
$info = {};
$Generic -> info($info);
---------------------------


And finally, it is the info method that tries to parse the info (inside 
Generic.pm)
---------------------------
sub info {
   my ($self,$info) = @_;
   no warnings;
   my $apache_headers =$apache->headers_in;
   $info->{father} =$apache->hostname;
   $info->{file} =$apache->filename;
   $info->{name} =$apache_headers->{'Referer'};
   $info->{content} =$apache_headers->{'Content-Type'};
   if ($apache->method eq 'POST') {
      if ($info->{content} =~ /.*multipart.*/) {
         my $mm =Apache::Request->new($apache,POST_MAX=>50000); #50k max
         my $uploads =$mm->upload();
         my $table =$mm->param(); #en teoria els uploads ja no estan
         warn $uploads.' '.%$uploads;
         warn $table.' '.%$table;
         foreach (keys %$uploads) {
            $uploads->{$_}->slurp(my $temp);
            warn 'IMAGE: '.$_.' - '.$uploads->{$_}.' ? '.$uploads->{$_}->name.' 
'.
            $uploads->{$_}->filename.' '.$uploads->{$_}->size.' 
'.$uploads->{$_}->type;
            }
         foreach (keys %$table){
            $info->{query} .= $_.'='.$table->{$_}.'&';
            warn $_.' = '.$table->{$_};
            }
      } else {
         if ($apache_headers->{'Content-length'} < 10000000) {
            $apache ->read($info->{query},$apache_headers->{'Content-length'});
            }
         }
   } elsif ($apache->method eq 'GET') {
      $info->{query} =$apache->args;
      }
   $info->{ip} =$apache->connection->remote_ip();
   $info->{cookie} =$apache_headers->{'Cookie'};
   }
---------------------------
Now reading rightly the content-type (lapsus:) the caret is inside the 
multipart block.
($apache is $r and is a global var for all the package).

What i read in error.log is
---------------------------
Apache::Upload::Table=HASH(0x10dd168) 0 at 
f:\tools\apache2/lib/perl/Blogum/Generic.pm
line 207.
Apache::Request::Table=HASH(0x10dab5c) 6 at 
f:\tools\apache2/lib/perl/Blogum/Generic.pm
line 208.
user = l at f:\tools\apache2/lib/perl/Blogum/Generic.pm line 218.
subject = l at f:\tools\apache2/lib/perl/Blogum/Generic.pm line 218.
source = l at f:\tools\apache2/lib/perl/Blogum/Generic.pm line 218.
image = aaaUntitled-1.gif at f:\tools\apache2/lib/perl/Blogum/Generic.pm line 
218.
directory = news_st at f:\tools\apache2/lib/perl/Blogum/Generic.pm line 218.
body = ñli at f:\tools\apache2/lib/perl/Blogum/Generic.pm line 218.
---------------------------
(values of input are nonsense)

So i'm reading right the text values, but no news about my file (from which i 
have the
filename).

PD I've tried to be the clearest possible, and i also offer my sympathy :D.
Please i will put more code if you ask for.





-------------------------------------------




>"eps com estem" <a
href="javascript:sendMsg('<[EMAIL PROTECTED]>');"><[EMAIL PROTECTED]></a> 
writes:
>> if ($apache->content_type() eq 'multipart/form-data') {
>No.  $r->content_type() represents the response (outgoing) header,
>not the request (incoming) header:
>   <a
href="/app/message?l=es&o=8&url=http%3A%2F%2Fperl%2Eapache%2Eorg%2Fdocs%2F2%2E0%2Fapi%2FApache%2FRequestRec%2Ehtml%23C%5Fcontent%5Ftype%5F"
target="_blank">http://perl.apache.org/docs/2.0/api/Apache/RequestRec.html#C_content_type_</a>
>>
>> While i'm able to read all text params, there are no entries in $uploads.
>No clue.  I'd like to help, but puzzling out the problem
>from your code snippets isn't sufficient enticement.  Please
>post full details, including a complete package+handler with
>configuration info and error-log output.  Maybe it's an apreq
>bug, maybe it isn't.  But if I can't reproduce your problem
>locally, there's not much I can do other than offer you my
>sympathy.
>--
>Joe Schaefer
---------------------------------------------------------
Esta Navidad, sé más original ¿Te atreves a enviar una postal con tu voz? 
http://greetingmania.ya.com
Ya.com ADSL Router Wi-Fi: Sólo 29,90 €/mes + IVA*. Router + Antivirus y 
firewall ¡Gratis! http://acceso.ya.com/adsl/256router

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to