search

Home  >  Q&A  >  body text

curl_setopt(): filename cannot be empty - rewrite header: curl_setopt(): filename cannot be empty

<p>I tried running the test and got this error</p> <pre class="brush:php;toolbar:false;">In Acceptance.php line 97:</pre> <p>curl_setopt(): The file name cannot be empty</p> <p>My Acceptence.php file</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粉696605833455 days ago470

reply all(1)I'll reply

  • P粉545682500

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

    I solved the problem, the fact was that the function "codecept_output_dir()" got the wrong path, thus causing the error. Thank you for your suggestions and answers)

    reply
    0
  • Cancelreply