Charles K. Clarkson wrote:
Scott R. Godin <mailto:[EMAIL PROTECTED]> wrote:

: Regrettably this isn't getting me any closer to a resolution --
: what about the code? can anyone see anything I might have
: overlooked? done wrong? should it, in fact, be working right
: now?

   Did you test to be certain that @file actually holds the contents
of the uploaded file?

use CGI::Carp 'fatalsToBrowser;
my @file = <$fields{file_attached}>;
die @file;

    Use a small file for the test.

: I had hoped this would be pretty straightforward, and tried my
: best to follow the examples in the docs and sample files, but
: I'm at a complete dead-end here. : : Anyone?


    I haven't looked at the docs but shouldn't 'Data' be set to
an array reference, not an array?

$message->attach(
    Type    => 'AUTO',
    Data    => @file,
    Disposition => 'attachment',
    Filename    => param('file_attached'),
    Encoding    => 'base64',
);

    Use:

    Data => [EMAIL PROTECTED],


That didn't work, but changing 'Data' to 'FH' did work, instead of slurping the file into an array, I passed the filehandle directly to the object's attach method.

Later, I additionally changed the Type to "BINARY" as MIME::Types doesn't seem to be installed on the system, (as Yahoo's mail attachment scanner showed the file type as 'auto/' for some reason), and everything still seems to be working fine.

now everything seems to be hunky dory. Don't know why it made a difference. but at least it works now. *headdesk*


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to