PERL BEGINNERS 35 RE MIME PARSER AGAIN DOWNLOAD PROBLEM
Subject: RE: mime::parser(again) download problem
Date: Fri, 8 Aug 2003 09:13:56 -0400

From: Stephen_Gilbert@no-spam (Stephen Gilbert)

> -----Original Message-----
> From: awards [mailto:awards@no-spam > Sent: Friday, August 08, 2003 8:54 AM > To: beginners@no-spam > Subject: mime::parser(again) download problem >=20
>=20
> Hi,
>=20
> This is how i'm retrieving messages(code below). The text is=20
> fine it is > perfectly downloading it.
> But for pictures attachment, the file has the size of the=20
> 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=20
> I can not > retrieve the pictures.
> any help is appreciated >=20
> awards >=20
> open(CURRMSG, "C:\\currmsg.txt") or die "Cannot open message: $!\n";
> my $uniq=3Dtime().'-'.$$;
> $entity=3D$parser->parse(\*CURRMSG);
> close CURRMSG;
> my @no-spam>parts;
> while(my $part =3D shift(@no-spam {
> if($part->parts) {
> push @no-spam>parts; # Nested multi-part > next;
> }
>=20
> my $filename=3D$part->head->recommended_filename;
> my $inputfile=3D$part->open("r");
> open(F,"> $attachdir/$uniq-$filename.jpg");
> while(read($inputfile,$buf,1024)) {
> print F $buf;
> }
> close(F);
> $inputfile->close;
> }
>=20
>=20
>=20
>=20
> --=20
> To unsubscribe, e-mail: beginners-unsubscribe@no-spam > For additional commands, e-mail: beginners-help@no-spam try:

my $uniq=3Dtime().'-'.$$;

$parser->extract_uuencode(1); # decode uuencode
$entity=3D$parser->parse(\*CURRMSG);

Let me know how you make out!


Subject: Re: mime::parser(again) download problem
Date: Fri, 8 Aug 2003 23:27:16 +0200

From: awards@no-spam (Awards)
Hi,

I figured the answer well someone on another forum told me.
it was open(F,...)
binmode(F);
** I thought files open were already in binmode.**
But this is due to my lack of knowledge.

Anthony
"Awards" <awards@no-spam> wrote in message news:20030808135035.44970.qmail@no-spam > Hi,
>
> I still have not found the error but I think the program reads everything as > Txt file, Because i send a .txt attachment it was perfectly read, but i send > a zip and a gif and I was not able to read >
> Awrds >
>