NAME

CTK::Plugin::FTP - FTP plugin

VERSION

Version 1.01

SYNOPSIS

use CTK;
my $ctk = new CTK(
        plugins => "ftp",
    );

$ctk->fetch_ftp(
    -url     => 'ftp://anonymous:anonymous@192.168.0.1/Public/test?Timeout=30',
    -op      => "copy", # copy / move
    -uniq    => 1, # 0 -- off; 1 -- on
    -mode    => "binary", # ascii / binary (default)
    -dirdst  => "/path/to/destination/dir", # Destination directory
    -filter  => qr/\.tmp$/,
);

$ctk->store_ftp(
    -url     => 'ftp://anonymous:anonymous@192.168.0.1/Public/test?Timeout=30',
    -op      => "copy", # copy / move
    -uniq    => 1, # 0 -- off; 1 -- on
    -mode    => "binary", # ascii / binary (default)
    -dirsrc  => "/path/to/source/dir", # Source directory
    -filter  => qr/\.tmp$/,
)

DESCRIPTION

FTP plugin

METHODS

fetch_ftp

$ctk->fetch_ftp(
    -url     => 'ftp://anonymous:anonymous@192.168.0.1/Public/test?Timeout=30',
    -op      => "copy", # copy / move
    -uniq    => 1, # 0 -- off; 1 -- on
    -mode    => "binary", # ascii / binary (default)
    -dirdst  => "/path/to/destination/dir", # Destination directory
    -files   => ['foo.tgz', 'bar.tgz', 'baz.tgz'],
);

Download specified files from resource

$ctk->fetch_ftp(
    -url     => 'ftp://anonymous:anonymous@192.168.0.1/Public/test?Timeout=30',
    -op      => "copy", # copy / move
    -uniq    => 1, # 0 -- off; 1 -- on
    -mode    => "binary", # ascii / binary (default)
    -dirdst  => "/path/to/destination/dir", # Destination directory
    -filter  => qr/\.tmp$/,
);

Download files from remote resource by regexp mask

-url

URL of resource.

For example:

ftp://anonymous:anonymous@192.168.0.1/Public/test?timeout=30

Timeout=30 -- FTP atrtributes. See Net::FTP

-dirout, -out, -dirdst, -dst, -target

Specifies destination directory

Default: current directory

-filter, -list, -mask, -files, -regexp
-list => [qw/ file1.txt file2.txt /]

List of files

-file => "file1.txt"

Name of file

-regexp => qr/\.(cgi|pl)$/i

Regexp

Default: undef (all files)

-op, -cmd, -command

Operation name. Allowed: copy, move

Default: copy

-uniq, -unique

Unique mode

Default: off

-mode

Defines transferring mode. Supported ASCII or Binary mode

-mode    => "binary", # ascii / binary (default)

Default: binary

store_ftp

$ctk->store_ftp(
    -url     => 'ftp://anonymous:anonymous@192.168.0.1/Public/test?Timeout=30',
    -op      => "copy", # copy / move
    -uniq    => 1, # 0 -- off; 1 -- on
    -mode    => "binary", # ascii / binary (default)
    -dirsrc  => "/path/to/source/dir", # Source directory
    -filter  => qr/\.tmp$/,
)

Upload files from local directory to remote resource by regexp mask

-url

URL of resource.

For example:

ftp://anonymous:anonymous@192.168.0.1/Public/test?Timeout=30

Timeout=30 -- FTP atrtributes. See Net::FTP

-dirin, -in, -dirsrc, -src, -source

Specifies source directory

Default: current directory

-filter, -list, -mask, -files, -regexp, -glob
-list => [qw/ file1.zip file2.zip /]

List of files

-file => "file1.zip"

Name of file

-glob => "*.zip"

Glob pattern

-regexp => qr/\.(zip|zip2)$/i

Regexp

Default: undef (all files)

-op, -cmd, -command

Operation name. Allowed: copy, move

Default: copy

-uniq, -unique

Unique mode

Default: off

-mode

Defines transferring mode. Supported ASCII or Binary mode

-mode    => "binary", # ascii / binary (default)

Default: binary

DEPENDENCIES

CTK, CTK::Plugin, Net::FTP

HISTORY

See Changes file

TO DO

See TODO file

BUGS

* none noted

SEE ALSO

CTK, CTK::Plugin, Net::FTP

AUTHOR

Serż Minus (Sergey Lepenkov) http://www.serzik.com <abalama@cpan.org>

COPYRIGHT

Copyright (C) 1998-2020 D&D Corporation. All Rights Reserved

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See LICENSE file and https://dev.perl.org/licenses/