GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Connector::Proxy::Net::FTP(3) User Contributed Perl Documentation Connector::Proxy::Net::FTP(3)

Connector::Proxy::Net::FTP

Read/Write files to/from a remote host using FTP.

LOCATION is the only mandatory parameter, if neither file nor path is set, the file is constructed from the arguments given to the method call.

LOCATION
The DNS name or IP of the target host.
port
Port number (Integer), default is 21.
file
Pattern for Template Toolkit to build the filename. The connector path components are available in the key ARGS. In set mode the unfiltered data is also available in key DATA. For security reasons, only word, space, dash, underscore and dot are allowed in the filename. If you want to include a directory, add the path parameter instead!
path
Same as file, but allows the directory seperator (slash and backslash) in the resulting filename. Use this for the full path including the filename as the file parameter is not used, when path is set!
basedir
A basedir which is always prepended to the path.
content
Pattern for Template Toolkit to build the content. The data is passed "as is". If data is a scalar, it is wrapped into a hash using DATA as key.
username
FTP username
password
FTP password
timeout
FTP connection timeout, default is 30 seconds
debug (Boolean)
Set the debug flag for Net::FTP
active (Boolean)
Use FTP active transfer. The default is to use passive transfer mode.
binary (Boolean)
Use binary or ascii transfer mode. Note that binary is the default!

Write data to a file.

    $conn->set('filename', { NAME => 'John Doe', 'ROLE' => 'Administrator' });

See the file parameter how to control the filename.

Fetch data from a file. See the file parameter how to control the filename.

    my $data = $conn->set('filename');

    Return the file names in the given directory.

    my $conn = Connector::Proxy::Net::FTP->new({
       LOCATION => 'localhost',
       file => '[% ARGS.0 %].txt',
       basedir => '/var/data/',
       content => ' Hello [% NAME %]',
    });

    $conn->set('test', { NAME => 'John Doe' });

Results in a file /var/data/test.txt with the content Hello John Doe.

To enable the scp transfer, the file is created on the local disk using tempdir/tempfile. The directory is created with permissions only for the current user, so no other user than root and yourself is able to see the content. The tempfile is cleaned up immediatly, the directory is handled by the internal garbage collection.
2022-02-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.