<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>CFFILE ACTION = "READBINARY"</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">CFFILE ACTION = "READBINARY"</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>
ページ内で使用できるバイナリオブジェクトのパラメータに、サーバー上の実行可能ファイルやイメージファイルなどのバイナリファイルを読み込みます。このファイルを HTTP や SMTP などの Web プロトコルを介して送信するか、またはデータベースに保管するには、ToBase64 関数を使用してファイルをまず Base64 に変換してください。 
</p>
<table>
  <tr valign="top">
    <td width="30"><strong>メモ: </strong></td>
    <td>このアクションによって、ファイルがローカル Variables スコープ内の変数に読み込まれます。サーバーがダウンするおそれがあるため、ログなどの大きなファイルには使用しないでください。</td>
  </tr>
</table>  <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;cffile
   action = &quot;readBinary&quot;
   file = &quot;full_path_name&quot;
   variable = &quot;var_name&quot;&gt;
</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>
cfdirectory
</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>
バイナリファイルを Base64 に変換して、それを別のサイトに転送します。
</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>
次の例では、バイナリファイル somewhere.jpg を読み込み、それを somewhereB.jpg として別のフォルダに書き込み、次にその新規ファイルを表示します。
</p>
<pre>&lt;cffile action = &quot;readBinary&quot; file = 
&quot;C:inetpubwwwrootcfdocsgetting_startedphotossomewhere.jpg&quot; variable = 
&quot;aBinaryObj&quot;&gt;
&lt;!--- バイナリオブジェクトを JPEG 形式に出力して表示します。 ---&gt;
&lt;cffile action=&quot;write&quot; file = &quot;c:filesupdatessomewhereB.jpg&quot; output = 
&quot;#toBinary(aBinaryObj)#&quot;&gt;
&lt;!--- イメージを表示する HTML です。 ---&gt;
&lt;img src=&quot;C:filesupdatessomewhereB.jpg&quot;&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>このタグが実行するファイル操作のタイプです。</p>

  </td>
  </tr>
  </table>
</div>
<div id="FILE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">FILE</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>
<p>絶対パス (ドライブ文字とコロン、あるいはスラッシュまたは円記号から始まるパス) を指定しなかった場合は、GetTempDirectory 関数から返される ColdFusion テンポラリディレクトリを基準とする相対パスになります。</p>

  </td>
  </tr>
  </table>
</div>
<div id="VARIABLE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VARIABLE</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>

  </body>
</html>
