From e62dfa2836db04ac84c1d63580340e72b13aae97 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 30 Mar 2008 17:04:01 +0000 Subject: [PATCH] Added new example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@256363 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/curl/functions/curl-setopt.xml | 54 ++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/reference/curl/functions/curl-setopt.xml b/reference/curl/functions/curl-setopt.xml index 24618e72b2..01e2271612 100644 --- a/reference/curl/functions/curl-setopt.xml +++ b/reference/curl/functions/curl-setopt.xml @@ -1,5 +1,5 @@ - + curl_setopt @@ -1142,9 +1142,7 @@ &reftitle.examples; - - Initializing a new cURL session and fetching a web page - + Initializing a new cURL session and fetching a web page + + + Uploading file + + '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); +?> +]]> + + &example.outputs; + + Foo +) +Array +( + [file] => Array + ( + [name] => test.png + [type] => image/png + [tmp_name] => /tmp/phpcpjNeQ + [error] => 0 + [size] => 279 + ) + +) + +]]> + + +