PHP Classes

File: test.php

Recommend this page to a friend!
  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: 19 years ago
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.";
?>