Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am ftp'ing in binary format (will not work in ascii since it is a zip file). Here is an example of the code I am using:
Thanks for any help or pointers.#!/usr/bin/perl use Net::FTP; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); $zip = Archive::Zip->new(); $member = $zip->addFile('some_file.txt'); $member = $zip->addFile('some_file2.txt'); $member = $zip->addFile('some_file3.txt'); die 'write error' if $zip->writeToFileNamed('some_zip_file.zip') != AZ +_OK; $ftp = Net::FTP->new("some_ip"); $ftp->login('user', 'pass'); $ftp->type("I"); # zip file is a binary file. $ftp->put('some_zip_file.zip'); $ftp->quit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unwanted text formatting with Archive::zip
by larryl (Monk) on Mar 15, 2001 at 23:30 UTC | |
|
Re: unwanted text formatting with Archive::zip
by the_slycer (Chaplain) on Mar 15, 2001 at 23:42 UTC | |
by extremely (Priest) on Mar 16, 2001 at 01:33 UTC | |
|
Re: unwanted text formatting with Archive::zip
by dvergin (Monsignor) on Mar 15, 2001 at 23:43 UTC |