Yükleniyor...

PHP FTP Fonksiyonları

PHP FTP Fonksiyonları
php-ftp-fonksiyonlari

resource ftp_connect ( string $host [, int $port = 21 [, int $timeout = 90 ]] )

bool ftp_login ( resource $ftp_stream , string $username , string $password )

bool ftp_cdup ( resource $ftp_stream )

bool ftp_chdir ( resource $ftp_stream , string $directory )

int ftp_chmod ( resource $ftp_stream , int $mode , string $filename )

bool ftp_close ( resource $ftp_stream )

bool ftp_delete ( resource $ftp_stream , string $path )

string ftp_mkdir ( resource $ftp_stream , string $directory )

string ftp_pwd ( resource $ftp_stream )

bool ftp_rename ( resource $ftp_stream , string $oldname , string $newname )

bool ftp_rmdir ( resource $ftp_stream , string $directory )

bool ftp_put ( resource $ftp_stream , string $remote_file , string $local_file , int $mode [, int $startpos = 0 ] )

bool ftp_get ( resource $ftp_stream , string $local_file , string $remote_file , int $mode [, int $resumepos = 0 ] )

int ftp_size ( resource $ftp_stream , string $remote_file )

int ftp_nb_get ( resource $ftp_stream , string $local_file , string $remote_file , int $mode [, int $resumepos = 0 ] )

int ftp_nb_put ( resource $ftp_stream , string $remote_file , string $local_file , int $mode [, int $startpos = 0 ] )

<?php
$file 'somefile.txt';
$remote_file 'readme.txt';

// set up basic connection
$conn_id ftp_connect($ftp_server);

// login with username and password
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

// upload a file
if (ftp_put($conn_id$remote_file$fileFTP_ASCII)) {
 echo "successfully uploaded $filen";
} else {
 echo "There was a problem while uploading $filen";
}

// close the connection
ftp_close($conn_id);
?>

 

  • SHARE

Tartışma




ya da
CAPTCHA Images