首頁  >  問答  >  主體

curl_setopt(): 檔名不能為空 - 重寫標題:curl_setopt():不能為空的檔名

<p>我嘗試運行測試並得到了這個錯誤</p> <pre class="brush:php;toolbar:false;">In Acceptance.php line 97:</pre> <p>curl_setopt(): 檔名不能為空</p> <p>我的Acceptence.php檔</p> <pre class="brush:php;toolbar:false;">$imgPath = codecept_output_dir() .'debug/fail.png'; curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'chat_id' => $chatID, 'photo' => new \CURLFile(realpath($imgPath)) ]);</pre>
P粉696605833P粉696605833389 天前414

全部回覆(1)我來回復

  • P粉545682500

    P粉5456825002023-08-30 00:08:23

    我解決了這個問題,事實是函數"codecept_output_dir()"獲取了錯誤的路徑,因此導致了錯誤。謝謝你的建議與答案)

    回覆
    0
  • 取消回覆