とカールを経由してファイルを送信:PHP - 私はカールを経由してファイルを送信しようとしているが、このエラーを取得維持しています。https
PHP Notice: Array to string conversion in /home/sasha/Documents/OffProjects/test/index.php on line 26
これは、現時点では私のコードです:
$target_url = 'https://address';
$file_name_with_full_path = realpath('mpthreetest.mp3');
$post = [
'textNote' => 'This is test',
'audioFile' => '@'.$file_name_with_full_path,
'department' => 'Test',
'timeDetected' => round(microtime(true) * 1000),
'subjectLine' => 'Test Test',
'recipients' => ['phone-number' => '111111111']
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_PORT, 443);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, true);
$result=curl_exec ($ch);
curl_close ($ch);
echo $result;
どのようにすることができます私はこれを機能させる?
最初に、行番号をコピー/貼り付けするか、26行目を強調表示する必要があります。そのため、エラーをより正確に推測することができます。 –