ID: 41610 Updated by: [EMAIL PROTECTED] Reported By: jiawan1234 at yahoo dot com -Status: Open +Status: Bogus Bug Type: cURL related Operating System: All PHP Version: 4.4.7 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. cURL has limited mechanisms for detecting the mime type, it is based on file extension. >From the cURL manual at http://curl.haxx.se/docs/manual.html you can specify the mime type by adding type after the name, in your case you would use "@MusicBox.mid;type=audio/midi" Previous Comments: ------------------------------------------------------------------------ [2007-06-06 10:26:34] jiawan1234 at yahoo dot com Description: ------------ When using curl upload file, mine type. eg: .mid .mid .mid or .midi should be "audio/midi" not "application/octet-stream" please check below... Reproduce code: --------------- function my_curl($url, $dataflds) { $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, true); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $dataflds); $result = curl_exec($ch); curl_close($ch); return $result; } $postdata['image_file'] = "@whiteflower.jpg"; $postdata['sound_file'] = "@MusicBox.mid"; echo my_curl("http://abc.com/info.php", $postdata); exit; Expected result: ---------------- _FILES["image_file"] Array ( [name] => whiteflower.jpg [type] => image/jpeg [tmp_name] => /var/tmp/phpwxA1au [error] => 0 [size] => 14546 ) _FILES["sound_file"] Array ( [name] => MusicBox.mid [type] => application/octet-stream [tmp_name] => /var/tmp/phpp2qVwa [error] => 0 [size] => 6569 ) Actual result: -------------- _FILES["image_file"] Array ( [name] => whiteflower.jpg [type] => image/jpeg [tmp_name] => /var/tmp/phpwxA1au [error] => 0 [size] => 14546 ) _FILES["sound_file"] Array ( [name] => MusicBox.mid [type] => audio/midi [tmp_name] => /var/tmp/phpp2qVwa [error] => 0 [size] => 6569 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41610&edit=1