Tussen twee Linux pc's gebruik ik het onderstaande script om te ftp'en echter ik kom er wel op maar ik kan vervolgens geen LISTING opvragen. Gewoon vanaf de prompt met <ftp hostname> lukt het wel. Ik zou zeggen dat het aan de firewall ligt die wellicht geen Passive Transfer toe laat maar dat is het toch niet.
Iemand een idee waarom deze module niet werkt ? Misschien dat iemand nog weet hoe je het script kunt aanpassen zodat ie ZEKER Active Transfers gebruikt ??
#!/usr/bin/perl
use Net::FTP::Common;
our %netftp_cfg =
(Debug => 1, Timeout => 120);
our %common_cfg =
(
#
# The first 2 options, if not present,
# lead to relying on .netrc for login
#
User => 'default',
Pass => '*********',
#
# Other options
#
LocalDir => '/tmp/uploads',
LocalFile => 'test.pl',
Host => 'www.providertest.nl',
RemoteDir => '/home/default/Scripts',
Type => 'A'
);
$ez = Net::FTP::Common->new(\%common_cfg, %netftp_config);
$ez->login or die "cant login: $@";
# $ez->send(LocalFile => 'test.pl');
#@listing = $ez->ls;
@listing = $ez->ls(RemoteDir => '/home/default');
Huidige uitvoer :
Net::FTP=GLOB(0x818b300)<<< 220 ProFTPD 1.2.7rc3 Server (ProFTPD Default Installation) [rtr0002.victspot.nl]
Net::FTP=GLOB(0x818b300)>>> user default
Net::FTP=GLOB(0x818b300)<<< 331 Password required for default.
Net::FTP=GLOB(0x818b300)>>> PASS ....
Net::FTP=GLOB(0x818b300)<<< 230 User default logged in.
Net::FTP=GLOB(0x82e9b04)<<< 220 ProFTPD 1.2.7rc3 Server (ProFTPD Default Installation) [rtr0002.victspot.nl]
Net::FTP=GLOB(0x82e9b04)>>> user default
Net::FTP=GLOB(0x82e9b04)<<< 331 Password required for default.
Net::FTP=GLOB(0x82e9b04)>>> PASS ....
Net::FTP=GLOB(0x82e9b04)<<< 230 User default logged in.
Net::FTP=GLOB(0x82e9b04)>>> CWD /home/default/Scripts
Net::FTP=GLOB(0x82e9b04)<<< 250 CWD command successful.
Net::FTP=GLOB(0x82e9b04)>>> TYPE A
Net::FTP=GLOB(0x82e9b04)<<< 200 Type set to A.
Net::FTP=GLOB(0x82e9b04)>>> PORT 192,168,1,40,188,56
Net::FTP=GLOB(0x82e9b04)<<< 200 PORT command successful
Net::FTP=GLOB(0x82e9b04)>>> NLST
EN NU MAAR WACHTEN ;-(
Iemand een idee waarom deze module niet werkt ? Misschien dat iemand nog weet hoe je het script kunt aanpassen zodat ie ZEKER Active Transfers gebruikt ??
#!/usr/bin/perl
use Net::FTP::Common;
our %netftp_cfg =
(Debug => 1, Timeout => 120);
our %common_cfg =
(
#
# The first 2 options, if not present,
# lead to relying on .netrc for login
#
User => 'default',
Pass => '*********',
#
# Other options
#
LocalDir => '/tmp/uploads',
LocalFile => 'test.pl',
Host => 'www.providertest.nl',
RemoteDir => '/home/default/Scripts',
Type => 'A'
);
$ez = Net::FTP::Common->new(\%common_cfg, %netftp_config);
$ez->login or die "cant login: $@";
# $ez->send(LocalFile => 'test.pl');
#@listing = $ez->ls;
@listing = $ez->ls(RemoteDir => '/home/default');
Huidige uitvoer :
Net::FTP=GLOB(0x818b300)<<< 220 ProFTPD 1.2.7rc3 Server (ProFTPD Default Installation) [rtr0002.victspot.nl]
Net::FTP=GLOB(0x818b300)>>> user default
Net::FTP=GLOB(0x818b300)<<< 331 Password required for default.
Net::FTP=GLOB(0x818b300)>>> PASS ....
Net::FTP=GLOB(0x818b300)<<< 230 User default logged in.
Net::FTP=GLOB(0x82e9b04)<<< 220 ProFTPD 1.2.7rc3 Server (ProFTPD Default Installation) [rtr0002.victspot.nl]
Net::FTP=GLOB(0x82e9b04)>>> user default
Net::FTP=GLOB(0x82e9b04)<<< 331 Password required for default.
Net::FTP=GLOB(0x82e9b04)>>> PASS ....
Net::FTP=GLOB(0x82e9b04)<<< 230 User default logged in.
Net::FTP=GLOB(0x82e9b04)>>> CWD /home/default/Scripts
Net::FTP=GLOB(0x82e9b04)<<< 250 CWD command successful.
Net::FTP=GLOB(0x82e9b04)>>> TYPE A
Net::FTP=GLOB(0x82e9b04)<<< 200 Type set to A.
Net::FTP=GLOB(0x82e9b04)>>> PORT 192,168,1,40,188,56
Net::FTP=GLOB(0x82e9b04)<<< 200 PORT command successful
Net::FTP=GLOB(0x82e9b04)>>> NLST
EN NU MAAR WACHTEN ;-(
[ Voor 36% gewijzigd door Verwijderd op 05-01-2003 15:49 ]