1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

improved CURLOPT_SAFE_UPLOAD documentation (fixes #70180)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337270 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker
2015-08-01 12:23:14 +00:00
parent d4d54d7bb6
commit b67451f6fb
2 changed files with 12 additions and 2 deletions

View File

@@ -110,6 +110,15 @@ array(3) {
an IV isn't provided.
</para>
</sect2>
<sect2 xml:id="migration56.incompatible.curl">
<title><link linkend="book.curl">cURL</link> file uploads</title>
<para>
Uploads using the @file syntax now require CURLOPT_SAFE_UPLOAD to be set to
&false;. <classname>CURLFile</classname> should be used instead.
</para>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -1484,7 +1484,7 @@
<row>
<entry>5.6.0</entry>
<entry>
<constant>CURL_SAFE_UPLOAD</constant> is now &true; by default.
<constant>CURLOPT_SAFE_UPLOAD</constant> is now &true; by default.
</entry>
</row>
<row>
@@ -1576,7 +1576,7 @@ curl_close($ch);
</para>
<para>
<example>
<title>Uploading file</title>
<title>Uploading file (deprecated as of PHP 5.5.0)</title>
<programlisting role="php">
<![CDATA[
<?php
@@ -1592,6 +1592,7 @@ $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);