curl_setopt(): filename cannot be empty - rewrite header: curl_setopt(): filename cannot be empty
P粉696605833
P粉696605833 2023-08-29 10:33:38
0
1
479
<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粉696605833
P粉696605833

reply all(1)
P粉545682500

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)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template