Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Corrupted ZIP file using MIME::Lite

by kirillm (Friar)
on Dec 30, 2007 at 19:48 UTC ( #659653=note: print w/replies, xml ) Need Help??


in reply to Corrupted ZIP file using MIME::Lite

Hi,

You're trying to attach your home directory:

$msg->attach( Type =>'application/zip', Path => $HOME, # ^^^^^^^^^^^^^^^^^ <- here you try to attach $HOME Filename =>'little.zip', Disposition => 'attachment' );

Probably you want Path to be "$HOME/little.zip"...

Hope that helps.

Greetz,
Kirill

Replies are listed 'Best First'.
Re^2: Corrupted ZIP file using MIME::Lite
by rlambert7 (Acolyte) on Dec 30, 2007 at 21:01 UTC
    No, that's not the problem. In the OP I said I am able to send and receive the email. It's just that the attached ZIP file is corrupted. Note that the MIME::Lite specification is "Path", not "Path/Filename". MIME::Lite has another specification for the file, which is "Filename".
      I believe you may be confused. The Filename attribute is only used to give the recipient a name for the attachment. The Path attribute should contain the full path to your zip file.

      For example,

      Path => '/home/rhesa/zips/small.zip', Filename => 'tiny.zip',
      would attach my file named "small.zip", but the recipient would see an attachment named "tiny.zip".

      Oh well. Here's a snip from MIME::Lite docs:

      Filename Optional. The name of the attachment. You can use this to supply a recommended filename for the end&#8208;user who is savi +ng the attachment to disk. You only need this if the filename at the end of the "Path" is inadequate, or if you’re using "Data" instead of "Path". You should not put path information in here (e.g., no "/" or "\" or ":" characters should be used). [...] Path Alternative to "Data" or "FH". Path to a file containing the data... actually, it can be any open()able expression. If it looks like a path, the last element will automatically be treated as the filename. See "ReadNow" also.

      Read these carefully...

      Have you tried my suggestion before you replied?

        No, I have tried, yet. I can't for at least a few days. But, my apologies, apparently I have relied on, what now appers to be, bad, rather detailed, info on another site. What you have provided looks sufficient to correct the problem.

        Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://659653]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-08-17 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?