downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

導入> <fam_suspend_monitor
[edit] Last updated: Fri, 10 Feb 2012

view this page in

FTP

  • 導入
  • インストール/設定
  • 定義済み定数
  • FTP 関数
    • ftp_alloc — アップロードされるファイルのためのスペースを確保する
    • ftp_cdup — 親ディレクトリに移動する
    • ftp_chdir — FTP サーバ上でディレクトリを移動する
    • ftp_chmod — FTP 経由でファイルのパーミッションを設定する
    • ftp_close — FTP 接続を閉じる
    • ftp_connect — FTP 接続をオープンする
    • ftp_delete — FTP サーバ上のファイルを削除する
    • ftp_exec — FTP サーバ上でのコマンドの実行をリクエストする
    • ftp_fget — FTP サーバからファイルをダウンロードし、オープン中のファイルに保存する
    • ftp_fput — オープン中のファイルを FTP サーバにアップロードする
    • ftp_get_option — カレント FTP ストリームでの種々の実行時動作を取得する
    • ftp_get — FTP サーバからファイルをダウンロードする
    • ftp_login — FTP 接続にログインする
    • ftp_mdtm — 指定したファイルが最後に更新された時刻を返す
    • ftp_mkdir — ディレクトリを作成する
    • ftp_nb_continue — ファイルの取得/送信を継続する(非ブロッキング)
    • ftp_nb_fget — FTP サーバからファイルをダウンロードし、オープン中のファイルに保存する(非ブロッキング)
    • ftp_nb_fput — オープン中のファイルを FTP サーバに保存する(非ブロッキング)
    • ftp_nb_get — FTP サーバからファイルを取得し、ローカルファイルに書き込む(非ブロッキング)
    • ftp_nb_put — FTP サーバにファイルを保存する(非ブロッキング)
    • ftp_nlist — 指定したディレクトリのファイルの一覧を返す
    • ftp_pasv — パッシブモードをオンまたはオフにする
    • ftp_put — FTP サーバにファイルをアップロードする
    • ftp_pwd — カレントのディレクトリ名を返す
    • ftp_quit — ftp_close のエイリアス
    • ftp_raw — FTP サーバに任意のコマンドを送信する
    • ftp_rawlist — 指定したディレクトリの詳細なファイル一覧を返す
    • ftp_rename — FTP サーバ上のファイルまたはディレクトリの名前を変更する
    • ftp_rmdir — ディレクトリを削除する
    • ftp_set_option — さまざまな FTP 実行時オプションを設定する
    • ftp_site — SITEコマンドをサーバに送信する
    • ftp_size — 指定したファイルのサイズを返す
    • ftp_ssl_connect — セキュアな SSL-FTP 接続をオープンする
    • ftp_systype — リモート FTP サーバのシステム型 ID を返す


add a note add a note User Contributed Notes FTP
tendrid at gmail dot com 21-Sep-2011 03:15
For those who dont want to deal with handling the connection once created, here is a simple class that allows you to call any ftp function as if it were an extended method.  It automatically puts the ftp connection into the first argument slot (as all ftp functions require).

This code is php 5.3+

<?php
class ftp{
    public
$conn;

    public function
__construct($url){
       
$this->conn = ftp_connect($url);
    }
   
    public function
__call($func,$a){
        if(
strstr($func,'ftp_') !== false && function_exists($func)){
           
array_unshift($a,$this->conn);
            return
call_user_func_array($func,$a);
        }else{
           
// replace with your own error handler.
           
die("$func is not a valid FTP function");
        }
    }
}

// Example
$ftp = new ftp('ftp.example.com');
$ftp->ftp_login('username','password');
var_dump($ftp->ftp_nlist());
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites