in reply to Zip up and email

First question... windows or unix? I know how to do it in Unix... the way I know requires you have the zip command for unix... to FTP you can use Net::FTP
use Net::FTP; `/usr/bin/zip -r zipfile.zip /directory/to/zip/`; #-r means recurse my $ftp = Net::FTP->new("some.host.name", Debug => 0); $ftp->login("anonymous",'me@here.there'); $ftp->cwd("/incoming"); $ftp->put("zipfile.zip"); $ftp->quit;
or to email you can use Mail::Sender
use Mail::Sender; `/usr/bin/zip -r zipfile.zip /directory/to/zip/`; #-r means recurse my $sender = new Mail::Sender {smtp => 'mail.yourdomain.com', from => 'your@address.com'}; $sender->MailFile({to => 'some@address.com', subject => 'Here is the file', msg => "your message here.", file => 'zipfile.zip'});
I believe both of these modules will work in windows as well... but the zip command would be different...

                - Ant
                - Some of my best work - Fish Dinner

Replies are listed 'Best First'.
Re: Re: Zip up and email
by Anonymous Monk on Aug 10, 2001 at 23:13 UTC
    Ok, thanks for your suggestions.

    I should also mention that this is to be used on a web server as part of a cgi program.

    Will this make a difference?
      If it takes a long time (like more than a minute) you might want to background the process... otherwise, no.

                      - Ant
                      - Some of my best work - Fish Dinner