|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-25 19:02 UTC] sniper@php.net
[2004-03-07 11:54 UTC] brianl at stcu dot org
[2005-02-24 03:28 UTC] jplock at yahoo dot com
[2010-11-19 01:15 UTC] jani@php.net
-Package: Feature/Change Request
+Package: cURL related
-PHP Version: 4CVS, 5CVS
+PHP Version: *
[2011-12-07 16:36 UTC] pierrick@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: pierrick
[2011-12-07 16:36 UTC] pierrick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 22:00:01 2025 UTC |
Description: ------------ From the cURL manual: If you want the contents to be read from a file, use <@filename> as contents. When specifying a file, you can also specify the file content type by appending ';type=<mime type>' to the file name. However, specifing MIME types is not currently supported within PHP. Reproduce code: --------------- $ch= curl_init('http://www.example.com/fupl.php'); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_POSTFIELDS, array('field1'=>'1','field2'=>'2','file'=>'@filepath.ext;type=application/xml')); $result= curl_exec($ch); curl_close($ch); Expected result: ---------------- The file should be uploaded with a Content-Type: application/xml header. Actual result: -------------- The entire call fails.