Net_SFTP

# Procedural File: SFTP.php

Source Location: /lib/3rdParty/phpseclib/Net/SFTP.php

## Classes:

Net_SFTP
  Pure-PHP implementations of SFTP.

## Page Details:

Pure-PHP implementation of SFTP.

PHP versions 4 and 5

Currently only supports SFTPv3, which, according to wikipedia.org, "is the most widely used version, implemented by the popular OpenSSH SFTP server". If you want SFTPv4/5/6 support, provide me with access to an SFTPv4/5/6 server.

The API for this library is modeled after the API from PHP's FTP extension.

Here's a short example of how to use this library:

1. <?php
2. include('Net/SFTP.php');
4. $sftp = new Net_SFTP ('www.domain.tld');
5. if (!$sftp->login('username', 'password')) {
6. exit('Login Failed');
7. }
9. echo $sftp->pwd() . "\r\n";
10. $sftp->put('filename.ext', 'hello, world!');
11. print_r ($sftp->nlist());
12. ?>

LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#### Tags:

author: | Jim Wigginton <terrafrost@php.net>
version: | $Id: SFTP.php,v 1.1 2010/05/14 14:06:16 gruberroland Exp $
copyright: | MMIX Jim Wigginton
link: | http://phpseclib.sourceforge.net
license: | http://www.gnu.org/licenses/lgpl.txt

#### Includes:

require_once('Net/SSH2.php') [line 58]
Include Net_SSH2

### NET_SFTP_LOCAL_FILE [line 92]

`NET_SFTP_LOCAL_FILE = 1`

Reads data from a local file.

#### Tags:

see: | Net_SFTP::put()
access: | public

[ Top ]

### NET_SFTP_LOG_COMPLEX [line 71]

`NET_SFTP_LOG_COMPLEX = NET_SSH2_LOG_COMPLEX`

Returns the message content

#### Tags:

see: | Net_SFTP::getLog()
access: | public

[ Top ]

### NET_SFTP_LOG_SIMPLE [line 67]

`NET_SFTP_LOG_SIMPLE = NET_SSH2_LOG_SIMPLE`

Returns the message numbers

#### Tags:

see: | Net_SFTP::getLog()
access: | public

[ Top ]

### NET_SFTP_STRING [line 96]

`NET_SFTP_STRING = 2`

Reads data from a string.

#### Tags:

see: | Net_SFTP::put()
access: | public

[ Top ]

Documentation generated on Thu, 28 Oct 2010 21:00:35 +0200 by phpDocumentor 1.4.1