Login   Register  
PHP Classes
elePHPant
Icontem

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: 2004-05-06 15:59
Size: 602 bytes
 

Contents

Class file image Download
<?php
$send_file 
'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
// FTP_ASCII or FTP_BINARY
$err $ftp->sendfile($remote_file$send_file"FTP_BINARY");

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