Send file to API with PHP using cURL
<p>I am trying to upload a file to this API : <a href="http://www.noelshack.com/api.php" rel="nofollow">http://www.noelshack.com/api.php</a>
I don't know anything about cURL. I have find sample codes, and i have try this :</p>

<pre><code>&lt;?php

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.noelshack.com/api.php');

// send a file
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt(
    $curl,
    CURLOPT_POSTFIELDS,
    array(
      'fichier' =&gt; '@http://cdn.soccerwiki.org/images/player/2386.jpg'
    ));

// output the response
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
print_r($result);

curl_close($curl);

?&gt;
</code></pre>

<p>Can anyone explain me with my current code don't work ?
It should return a url like this : <a href="http://www.noelshack.com/2016-XX-XXXXXXXXXX-2386.png" rel="nofollow">http://www.noelshack.com/2016-XX-XXXXXXXXXX-2386.png</a></p>

<p>But it didn't return anything. There aren't any error in my code, the file is juste not uploaded, and i don't know why because i don't know how to display api errors !</p>

<p>Thanks in advance</p>

<p>(sorry for my english, i'm french) </p>