PHP Classes

File: ftp.php

Recommend this page to a friend!
  Classes of David Passey  >  ZEND_EPS_PUTTY  >  ftp.php  >  Download  
File: ftp.php
Role: Example script
Content type: text/plain
Description: Example script & further info
Send files to secure FTP server using Putty
Author: By
Last change: Fix slight spelling error.
Date: 6 years ago
Size: 2,815 bytes


Class file image Download

 * Example script to show the functionality of ZEND_EPS_PUTTY.
 * You will need the PuTTY application installed on your computer.
 * You will need the Zend Framework installed.
 * You will need an XML config file to pass to the class so FTP settings can be configured. Just supply
 * the necessary path to the file and the root node name. This allows for multiple FTP server configurations
 * in one file.
 * The output files are a log file that contains the FTP batch commands and an XML results file that
 * has all of the results of the batch commands. This file can be parsed for usage within the calling script.
 * The lines below will customize the log and results files, make directories on the remote server,
 * send files, move files, get files, and then delete the directories and any files in them.
 * XML config file settings instructions:
 * <putty_path> = Where you installed the PuTTY application. This can be blank if this path is in your PATH environment.
 * <ftp1> = Some type of parent node. Call it anything you wish and use this name when you create the instance.
 * <host> = The FTP host.
 * <port> = The port to use. Defaults to 22 if left blank.
 * <username> = The user name.
 * <password> = The password.
 * <local_upload_path> = The local path for uploading files from.
 * <local_download_path> = The local path for downloading files to.
 * <remote_path> = The remote path to start the session in. Usually defaults to the FTP home directory or "/".
 * <results_path> = The local path where the results file should be written to.
 * <log_path> = The local path where the log file should be written to.

require_once 'lib/';

$con = new ZEND_EPS_PUTTY('c:/php/includes/config/ftp_config.xml','ftp1');
$con->setLogText('### begin log ###', '### end log ###');