<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFFTP: 接続 : ファイルおよびディレクトリのオペレーション</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFFTP: 接続 : ファイルおよびディレクトリのオペレーション</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">説明</span>
<p>
cfftp を使用してファイルおよびディレクトリのオペレーションを行うには、この形式の cfftp タグを使用します。
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</span><pre>&lt;cfftp
   action = &quot;action&quot;
   username = &quot;name&quot;
   password = &quot;password&quot;
   name = &quot;query_name&quot;
   server = &quot;server&quot;
   ASCIIExtensionList = &quot;extensions&quot;
   transferMode = &quot;mode&quot;
   failIfExists = &quot;yes&quot;、&quot;no&quot;
   directory = &quot;directory name&quot;
   localFile = &quot;filename&quot;
   remoteFile = &quot;filename&quot;
   item = &quot;directory&quot;、&quot;file&quot;
   existing = &quot;file&quot;、&quot;directory name&quot;
   new = &quot;file&quot;、&quot;directory name&quot;
   proxyServer = &quot;proxy server&quot;
   passive = &quot;yes&quot;、&quot;no&quot;&gt;
result = &quot;result_name&quot;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">関連項目</span>
<p>
cfhttp、cfldap、cfmail、cfpop
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">使用方法</span>
<p>
アクティブな FTP 接続への接続キャッシュを使用する場合は、username、password、または server 接続属性を再指定する必要はありません。
</p>

<p>
キャッシュされている接続を変更するときには (retryCount 値や timeout 値を変更する場合など)、接続の再確立が必要になることがあります。 
</p>

<p>
action = &quot;listDir&quot; の場合、attributes 列には directory または normal が返されます。その他の hidden や system といったプラットフォーム特有の値は、現在はサポートされていません。
</p>

<p>
action = &quot;listDir&quot; の場合は、mode 列が返されます。この列には、UNIX アクセス許可を表す 8 進数の文字列表記が含まれています (例 : &quot;777&quot;)。
</p>

<p>
cfftp.returnValue 変数は、次のアクションについての戻り値を返します。
</p>
<ul>

<li>getCurrentDir</li>

<li>getCurrentURL</li>

<li>existsDir</li>

<li>existsFile</li>

<li>exists</li>
</ul>

<p>
詳細については、『ColdFusion MX 開発ガイド』 を参照してください。
</p>
<table>
  <tr valign="top">
    <td width="30"><strong>注意: </strong></td>
    <td>ファイルやディレクトリなどのオブジェクト名では、大文字と小文字が区別されます。 </td>
  </tr>
</table>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">アクションと cfftp.ReturnValue 変数</span>
<p>
アクションの結果によって、returnValue 変数の値が次の表のように決まります。
</p>

<p>
</p><div align="left">
<table border="1">
  <caption></caption>
  <tr align="center">    <th><strong>cfftp アクション</strong></th>
    <th><strong>cfftp.returnValue の値</strong></th>
</tr>
  <tr align="left">    <td>
<p>getCurrentDir</p></td>
    <td>
<p>文字列値です。現在のディレクトリです。</p></td>
</tr>
  <tr align="left">    <td>
<p>getCurrentURL</p></td>
    <td>
<p>文字列値です。現在の URL です。</p></td>
</tr>
  <tr align="left">    <td>
<p>existsDir</p></td>
    <td>
<p>yes または no です。</p></td>
</tr>
  <tr align="left">    <td>
<p>existsFile</p></td>
    <td>
<p>yes または no です。</p></td>
</tr>
  <tr align="left">    <td>
<p>exists</p></td>
    <td>
<p>yes または no です。</p></td>
</tr>
</table>
</div>
<p>
</p>

<p>
returnValue 変数にアクセスするには、result 属性で指定される値 (その値が設定されている場合) または cfftp を変数の前に付ける必要があります。result 属性は、複数のページから同時に行われる可能性がある cfftp 呼び出しについて、一方の呼び出しの結果が他方の呼び出しの結果を上書きしないようにするための方法を提供します。result 属性を myResult に設定した場合は、たとえば myResult.returnVariable として returnVariable 変数にアクセスします。あるいは、cfftp.returnVariable としてこの変数にアクセスします。
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">例</span>
<p>
次の例では、接続を開き、ファイルリストを取得し、ファイル名、ディレクトリ名、パス、URL、長さ、および修正日を表示します。 
</p>
<pre>&lt;p&gt;接続を開きます。
&lt;cfftp connection = &quot;myConnection&quot;
   username = &quot;myUserName&quot;
   password = &quot;myUserName@allaire.com&quot;
   server = &quot;ftp.allaire.com&quot;
   action = &quot;open&quot;
   stopOnError = &quot;Yes&quot;&gt; 

&lt;p&gt;成功しましたか? &lt;cfoutput&gt;#cfftp.succeeded#&lt;/cfoutput&gt;
&lt;cfftp connection = &quot;myConnection&quot;
    action = &quot;LISTDIR&quot;
    stopOnError = &quot;Yes&quot;
    name = &quot;ListDirs&quot;
    directory = &quot;/&quot;&gt;

&lt;p&gt;FTP ディレクトリリスト&lt;br&gt;
&lt;cftable query = &quot;ListDirs&quot; HTMLTable = &quot;Yes&quot; colHeaders = &quot;Yes&quot;&gt; 
   &lt;cfcol header = &quot;&lt;b&gt;名前&lt;/b&gt;&quot; text = &quot;#name#&quot;&gt;  
   &lt;cfcol header = &quot;&lt;b&gt;パス&lt;/b&gt;&quot; text = &quot;#path#&quot;&gt; 
   &lt;cfcol header = &quot;&lt;b&gt;URL&lt;/b&gt;&quot; text = &quot;#url#&quot;&gt; 
   &lt;cfcol header = &quot;&lt;b&gt;長さ&lt;/b&gt;&quot; text = &quot;#length#&quot;&gt;
   &lt;cfcol header = &quot;&lt;b&gt;最終修正日&lt;/b&gt;&quot;
    text = &quot;#DateFormat(lastmodified)#&quot;&gt;  
   &lt;cfcol header = &quot;&lt;b&gt;IsDirectory&lt;/b&gt;&quot; text = &quot;#isdirectory#&quot;&gt;
&lt;/cftable&gt;

&lt;p&gt;イメージファイルをリモートサーバーに移動します。&lt;br&gt;&lt;/p&gt;
&lt;!--- 特記なき限り、イメージは FTP サーバーのルートディレクトリに配置
されます。 
例 : remoteFile = &quot;somewhere_put.jpg&quot; vs remoteFile = &quot;/support/somewhere_put.jpg&quot;
---&gt; 
&lt;cfftp
connection = &quot;myConnection&quot;
action = &quot;putFile&quot; 
name = &quot;uploadFile&quot; 
transferMode = &quot;binary&quot; 
localFile = &quot;C:filesuploadsomewhere.jpg&quot; 
remoteFile = &quot;somewhere_put.jpg&quot; 
&gt;
&lt;p&gt;成功しましたか? &lt;cfoutput&gt;#cfftp.succeeded#&lt;/cfoutput&gt;

&lt;p&gt;接続を閉じます。
&lt;cfftp connection = &quot;myConnection&quot;
    action = &quot;close&quot;
    stopOnError = &quot;Yes&quot;&gt;
&lt;p&gt;成功しましたか? &lt;cfoutput&gt;#cfftp.succeeded#&lt;/cfoutput&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="ACTION">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ACTION</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">接続がキャッシュされていない場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>実行する FTP オペレーションです。</p><ul>

<li>changedir</li>

<li>createDir</li>

<li>listDir</li>

<li>removeDir</li>

<li>getFile</li>

<li>putFile</li>

<li>rename</li>

<li>remove</li>

<li>getCurrentDir</li>

<li>getCurrentURL</li>

<li>existsDir</li>

<li>existsFile</li>

<li>exists</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="USERNAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">USERNAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">接続がキャッシュされていない場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>FTP オペレーションで渡すユーザー名です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PASSWORD">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PASSWORD</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;open&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ユーザーがログインするためのパスワードです。</p>

  </td>
  </tr>
  </table>
</div>
<div id="NAME">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">NAME</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;listDir&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ディレクトリリストのクエリー名です。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="SERVER">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">SERVER</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">FTP 接続がキャッシュされていない場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>接続先の FTP サーバーです (例 : ftp.myserver.com)。</p>

  </td>
  </tr>
  </table>
</div>
<div id="ASCIIEXTENSIONLIST">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ASCIIEXTENSIONLIST</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "txt;htm;html;cfm;cfml;<br>shtm;shtml;<br>css;asp;asa"


<p>transferMode = &quot;auto&quot; のときに強制的に ASCII 転送モードを使用するファイル拡張子のリストです。セミコロンで区切って指定します。 </p>

  </td>
  </tr>
  </table>
</div>
<div id="TRANSFERMODE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TRANSFERMODE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "Auto"

<ul>

<li>ASCII FTP 転送モード</li>

<li>Binary FTP 転送モード</li>

<li>Auto FTP 転送モード</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="FAILIFEXISTS">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">FAILIFEXISTS</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "yes"

<ul>

<li>yes: 同じ名前のローカルファイルが存在する場合、getFile アクションは失敗します。</li>

<li>no</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="DIRECTORY">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">DIRECTORY</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;changedir&quot;、&quot;createDir&quot;、&quot;listDir&quot;、または &quot;existsDir&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>オペレーションの対象となるディレクトリです。</p>

  </td>
  </tr>
  </table>
</div>
<div id="LOCALFILE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">LOCALFILE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;getFile&quot; または &quot;putFile&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>ローカルファイルシステム上にあるファイルの名前です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="REMOTEFILE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">REMOTEFILE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;getFile&quot;、&quot;putFile&quot;、または &quot;existsFile&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>FTP サーバーファイルシステム上にあるファイルの名前です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="ITEM">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ITEM</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;getAll&quot; または &quot;getHeaderOnly&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>これらのアクションの対象となるファイルまたはディレクトリです。</p>

  </td>
  </tr>
  </table>
</div>
<div id="EXISTING">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">EXISTING</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;rename&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>リモートサーバー上にあるファイルまたはディレクトリの現在の名前です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="NEW">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">NEW</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">action = &quot;rename&quot; の場合は必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>リモートサーバー上にあるファイルまたはディレクトリの新規名です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PROXYSERVER">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PROXYSERVER</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>文字列で指定します。プロキシアクセスを指定した場合に使用するプロキシサーバーの名前です。</p>

  </td>
  </tr>
  </table>
</div>
<div id="PASSIVE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">PASSIVE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "no"

<ul>

<li>yes: passive モードを有効にします。</li>

<li>no</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="RESULT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">RESULT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">オプション</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>cfftp で returnValue 変数を格納する格納先の構造体の名前を指定します。指定すると、その値が接頭辞として cfftp の代わりに使用され、returnVariable にアクセスするときに使われます。詳細については、「使用方法」を参照してください。</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
