Remove obsolete PHP 5 specific info regarding cURL file uploads

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@351291 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2020-11-07 14:33:22 +00:00
parent 323eb8f48d
commit b39b2fcb92

View file

@ -465,21 +465,6 @@
<entry valign="top">
</entry>
</row>
<row>
<entry valign="top"><constant>CURLOPT_SAFE_UPLOAD</constant></entry>
<entry valign="top">
&true; to disable support for the <literal>@</literal> prefix for
uploading files in <constant>CURLOPT_POSTFIELDS</constant>, which
means that values starting with <literal>@</literal> can be safely
passed as fields. <classname>CURLFile</classname> may be used for
uploads instead.
</entry>
<entry valign="top">
Added in PHP 5.5.0 with &false; as the default value. PHP 5.6.0
changes the default value to &true;. PHP 7 removes this option;
the CURLFile interface must be used to upload files.
</entry>
</row>
<row>
<entry valign="top"><constant>CURLOPT_SASL_IR</constant></entry>
<entry valign="top">
@ -1546,10 +1531,7 @@
<entry valign="top">
<simpara>
The full data to post in a HTTP "POST" operation.
To post a file, prepend a filename with <literal>@</literal> and
use the full path. The filetype can be explicitly specified by
following the filename with the type in the format
'<literal>;type=mimetype</literal>'. This parameter can either be
This parameter can either be
passed as a urlencoded string like '<literal>para1=val1&amp;para2=val2&amp;...</literal>'
or as an array with the field name as key and field data as value.
If <parameter>value</parameter> is an array, the
@ -1557,15 +1539,8 @@
<literal>multipart/form-data</literal>.
</simpara>
<simpara>
As of PHP 5.2.0, <parameter>value</parameter> must be an array if
files are passed to this option with the <literal>@</literal> prefix.
</simpara>
<simpara>
As of PHP 5.5.0, the <literal>@</literal> prefix is deprecated and
files can be sent using <classname>CURLFile</classname>. The
<literal>@</literal> prefix can be disabled for safe passing of
values beginning with <literal>@</literal> by setting the
<constant>CURLOPT_SAFE_UPLOAD</constant> option to &true;.
Files can be sent using <classname>CURLFile</classname>,
in which case <parameter>value</parameter> must be an array.
</simpara>
</entry>
<entry valign="top">
@ -2392,55 +2367,6 @@ curl_close($ch);
</programlisting>
</example>
</para>
<para>
<example>
<title>Uploading file (deprecated as of PHP 5.5.0)</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_SAFE_UPLOAD, false); // required as of PHP 5.6.0
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="notes">