Answer the question
In order to leave comments, you need to log in
Why is the Photo field returned empty?
There is this code:
$post_params = array(
'photo'=> 'myscreenshot.png'
);
$ch = curl_init($serverArray);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
$response = curl_exec( $ch );
curl_close( $ch );
echo($response);
Answer the question
In order to leave comments, you need to log in
Use this to send a file using CURL:
php.net/manual/en/class.curlfile.php Better
yet, learn how to use Guzzle.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question