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 + ) + +) + +]]> + + +