在IIS 8.5上使用PHP 7.3.1
以下代码返回HTTP代码0
<?php
$filename = 'ث.mp3';
$file = curl_file_create($filename,'audio/mpeg',basename($filename));
$options = array(
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_POSTFIELDS => array('file' => $file)
);
$ch = curl_init("https://httpbin.org/post");
curl_setopt_array($ch, $options);
$data = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
echo $info['http_code'];
将第一行更改为$filename = test.mp3
会使请求成功,并返回HTTP代码200
我收集到负责此行为的libcurl API-请参见https://bugs.php.net/bug.php?id=77262
除了重命名文件外,有人知道解决方法吗?