Login   Register  
PHP Classes

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Dod Pertez  >  FTP  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: testing put file on ftp server
Class: FTP
Sending files to a FTP server
Author: By
Last change:
Date: 10 years ago
Size: 602 bytes


Class file image Download
'xxx.jpg';        // file for sending
$remote_file 'yyy.jpg';    // destination file

$ftp_server "";        // add server name
$ftp_user_name "";    // add user name
$ftp_user_pass "";    // add password
$dst_dir "";            // add destination directory ( www/upload/ )

//include class
include ("class.FTP.php");

//class constructor
$ftp = new ftp($ftp_server,$ftp_user_name,$ftp_user_pass,$dst_dir);

// sending any file
$err $ftp->sendfile($remote_file$send_file"FTP_BINARY");

if (!
$err) echo "No transfer !";
else echo 
"Transfer OK.";