Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 18319 invoked from network); 6 Apr 2006 16:31:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2006 16:31:07 -0000 Received: (qmail 33243 invoked by uid 500); 6 Apr 2006 16:31:00 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 33227 invoked by uid 500); 6 Apr 2006 16:31:00 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 33216 invoked by uid 99); 6 Apr 2006 16:31:00 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2006 09:31:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [68.142.229.100] (HELO smtp105.sbc.mail.re2.yahoo.com) (68.142.229.100) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 06 Apr 2006 09:30:58 -0700 Received: (qmail 79215 invoked from network); 6 Apr 2006 16:30:34 -0000 Received: from unknown (HELO jupiterhost.net) (dan.muey@sbcglobal.net@198.66.78.2 with plain) by smtp105.sbc.mail.re2.yahoo.com with SMTP; 6 Apr 2006 16:27:57 -0000 Message-ID: <4435418B.9000707@jupiterhost.net> Date: Thu, 06 Apr 2006 11:27:55 -0500 From: "JupiterHost.Net" User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: modperl@perl.apache.org Subject: Re: Mail::POP3Client and pdf decode References: <442D5A8A.5030306@vendingmexico.com> <1143824137.20593.6.camel@localhost.localdomain> <4434E61C0200009D00017EA7@inet-wh1.gmhwh.org> In-Reply-To: <4434E61C0200009D00017EA7@inet-wh1.gmhwh.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Charlie Smith wrote: > I'm trying to decode an email that was pop'd. After writing > the body to a disk file using the perl Mail::POP3Client routine > $pop->BodyToFile( $fh, 1); > > It looks all like text. So, I run following command to translate by "it looks all like text" do you mean its "like words" or "an ascii armoured" string? > body of mime message back to pdf for reading. > perl -MMIME::Base64 -ne 'print decode_base64($_)' test.pdf test.txt is base64 encoded verison correct? does it have anytyhing in it that is not part of the encoding? If so then you're decoding that line and putting it in the pdf file After making sure test.txt is clean: perl -mstrict -MFile::Slurp -MMIME::Base64 -we 'my $b64 = read_file("test.txt");write_file("test.pdf", decode_base64($b64));' It cortaks if one of them fail so you're all set AFA error checking... > No error messages, but file size is different from original file poped Yes, the base 64 encoded verison will be a differtent size than the guts that were encoded... > from email attachment. When pdf file is brought up in browser, there > is no data. - Is the decoded version 0 in size? - are you outputting a header to tell the browser its a PDF? - any errors in screen, logs, etc Example code and url's to the symptoms would be extrememly handy to diagnose the problem, no?