cvs: phpdoc-ja /reference/curl/functions curl-setopt.xml

From: Date: Sun, 30 Mar 2008 21:00:14 +0000
Subject: cvs: phpdoc-ja /reference/curl/functions curl-setopt.xml
Groups: php.doc.ja 
Request: Send a blank email to doc-ja+get-2292@lists.php.net to get a copy of this message
takagi Sun Mar 30 21:00:14 2008 UTC Modified files: /phpdoc-ja/reference/curl/functions curl-setopt.xml Log: sync with en. http://cvs.php.net/viewvc.cgi/phpdoc-ja/reference/curl/functions/curl-setopt.xml?r1=1.15&r2=1.16&diff_format=u Index: phpdoc-ja/reference/curl/functions/curl-setopt.xml diff -u phpdoc-ja/reference/curl/functions/curl-setopt.xml:1.15 phpdoc-ja/reference/curl/functions/curl-setopt.xml:1.16 --- phpdoc-ja/reference/curl/functions/curl-setopt.xml:1.15 Sat Mar 8 04:57:38 2008 +++ phpdoc-ja/reference/curl/functions/curl-setopt.xml Sun Mar 30 21:00:14 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.15 $ --> -<!-- EN-Revision: 1.28 Maintainer: hirokawa Status: ready --> +<!-- $Revision: 1.16 $ --> +<!-- EN-Revision: 1.30 Maintainer: hirokawa Status: ready --> <!-- CREDITS: takagi --> <refentry xml:id="function.curl-setopt" xmlns="http://docbook.org/ns/docbook"> <refnamediv> @@ -779,7 +779,7 @@ <entry> HTTP "POST" で送信するすべてのデータ。 ファイルを送信するには、ファイル名の先頭に <literal>@</literal> - をつけます。 + をつけてフルパスを指定します。 </entry> <entry> </entry> @@ -1135,9 +1135,7 @@ &reftitle.examples; <para> <example> - <title> - 新規に cURL セッションを初期化、ウェブページを取得する - </title> + <title>新規に cURL セッションを初期化、ウェブページを取得する</title> <programlisting role="php"> <![CDATA[ <?php @@ -1158,6 +1156,54 @@ </programlisting> </example> </para> + <para> + <example> + <title>ファイルのアップロード</title> + <programlisting role="php"> +<![CDATA[ +<?php + +/* http://localhost/upload.php: +print_r($_POST); +print_r($_FILES); +*/ + +$ch = curl_init(); + +$data = array('name' => 'Foo', 'file' => '@/home/user/test.png'); + +curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload.php'); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + +curl_exec($ch); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Array +( + [name] => Foo +) +Array +( + [file] => Array + ( + [name] => test.png + [type] => image/png + [tmp_name] => /tmp/phpcpjNeQ + [error] => 0 + [size] => 279 + ) + +) + +]]> + </screen> + </example> + </para> </refsect1> <refsect1 role="seealso">

« previous php.doc.ja (#2292) next »