[wp-trac] [WordPress Trac] #41608: Post files using cURL

WordPress Trac noreply at wordpress.org
Fri Aug 11 06:58:36 UTC 2017


#41608: Post files using cURL
--------------------------+-----------------------------
 Reporter:  codealfa      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.8.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 It's impossible to post files by http using cURL via the WordPress API.

 If you look at the code in the ''setup_handle'' method in
 ''Requests_Transport_cURL'' class found in the ''/wp-
 includes/Requests/Transport/cURL.php'' file, you'll see that the POST data
 is always converted to a string using the PHP ''http_build_query''
 function. However, according to the PHP manual at
 [http://www.php.net/manual/en/function.curl-setopt.php], the value passed
 to CURLOPT_POSTFIELDS must be an array if files are passed to this option.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41608>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list