PHP 7.2 CURLFile Gives “Invalid Filename” Warning

前端 未结 1 752
囚心锁ツ
囚心锁ツ 2021-01-22 00:37

I am having an issue using the CURLFile object (curl_file_create). I have tried a number of approaches, but no matter what I try, I end up getting a PHP Warning in

1条回答
  •  有刺的猬
    2021-01-22 00:46

    Eureka. The problem is using curl_setopt_array. I was able to correct the issue like so:

    //$curlOpts[CURLOPT_POSTFIELDS] = $postFields;
    
    $log->UpdateDebugLog('Mailgun API Options', $curlOpts);
    
    curl_setopt_array($curl, $curlOpts);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $postFields);
    

    I didn't come across any documentation on this limitation with curl_setopt_array, so I'm not sure if this was improper usage on my part or if this is an unknown bug.

    0 讨论(0)
提交回复
热议问题