Hi,

Here are the option I forgot to put. Still does not work, I have second
script that works, but it creates a folders and puts automatically the files
inside that folder
But I want to try this way.

Thanx for the help!!
 open(CURRMSG,">c:\\currmsg.txt");
 $pop3->get($msg_id,\*CURRMSG);
 close CURRMSG;

 my $parser=new MIME::Parser;

 $parser->ignore_errors(1);
 $parser->extract_uuencode(1);
 $parser->tmp_recycling(0);
 $parser->output_to_core(1);

 open(CURRMSG, "C:\\currmsg.txt") or die "Cannot open message: $!\n";
 my $uniq=time().'-'.$$;
 $entity=$parser->parse(\*CURRMSG);
 close CURRMSG;

 my @parts=$entity->parts;
 while(my $part = shift(@parts)) {
      if($part->parts) {
           push @parts,$part->parts;
           next;
      }
      my $type=$part->head->mime_type || $part->head->effective_type;
      $cool = $part->head->mime_attr("Content-disposition");

       $filename = $part->head->recommended_filename;
        my $inputfile=$part->open("r");
        open(F,"> $attachdir/$uniq-$filename");
        my $buf;
        while($inputfile->read($buf,1024)) { ## i ALSO trid
read($inputfile,$buf,1024) but does not work
             print F $buf;
        }##end of $bug WHILE
 }## END OF THE $PART WHILE









"Stephen Gilbert" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


> -----Original Message-----
> From: awards [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 8:54 AM
> To: [EMAIL PROTECTED]
> Subject: mime::parser(again) download problem
>
>
> Hi,
>
> This is how i'm retrieving messages(code below). The text is
> fine it is
> perfectly downloading it.
> But for pictures attachment, the file has the size of the
> real picture, but
> I Can Not view the downloaded pictures.
> for example I'm sending picture aaa.jpg it is 16Kb.
> When I retrieve it i get 12321123-1233-aaa.jpg it is 16KB but
> I can not
> retrieve the pictures.
> any help is appreciated
>
> awards
>
> open(CURRMSG, "C:\\currmsg.txt") or die "Cannot open message: $!\n";
> my $uniq=time().'-'.$$;
> $entity=$parser->parse(\*CURRMSG);
> close CURRMSG;
> my @parts=$entity->parts;
> while(my $part = shift(@parts)) {
>       if($part->parts) {
>             push @parts,$part->parts; # Nested multi-part
>             next;
>        }
>
>        my $filename=$part->head->recommended_filename;
>        my $inputfile=$part->open("r");
>        open(F,"> $attachdir/$uniq-$filename.jpg");
>        while(read($inputfile,$buf,1024)) {
>             print F $buf;
>        }
>        close(F);
>        $inputfile->close;
> }
>
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
try:

my $uniq=time().'-'.$$;

$parser->extract_uuencode(1); # decode uuencode

$entity=$parser->parse(\*CURRMSG);

Let me know how you make out!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to