用图像php卷曲请求

Please help with a curl request, I read all the posts in stack but doesn't help.

I need to send a curl request in php (form with image).

Here's an example:

curl https://partners-api.999.md/images \
    --request "POST" \
    --user "AxYcHhZsPqHTpthS2C_7xRmPoLK:"
    --form "file=@image.jpg"

I tried this:

$file_url = "https://www.google.md/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"; 
    $eol = "
";
    $BOUNDARY = md5(time());
    $BODY="";
    $BODY.= '--'.$BOUNDARY. $eol; 
    $BODY .= 'Content-Disposition: form-data; name="file"; filename="googlelogo_color_272x92dp.png"' . $eol . $eol; 
    $BODY.= 'Content-Type: application/octet-stream' . $eol;
    $BODY.= 'Content-Transfer-Encoding: base64' . $eol . $eol;
    $BODY.= chunk_split(base64_encode(file_get_contents($file_url))) . $eol;
    $BODY.= '--'.$BOUNDARY .'--' . $eol. $eol;

$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: multipart/form-data; boundary=".$BOUNDARY));
curl_setopt($ch, CURLOPT_USERPWD, "token");
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/1.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0');
curl_setopt($ch, CURLOPT_URL, "https://partners-api.999.md/images");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $BODY);

$response = curl_exec($ch); 
print_r($response); 

I don't understand what's wrong, response is:

{
  "error": {
    "errors": [

    ],
    "reason": "bad_request",
    "code": 400,
    "message": "No handler matched this image"
  }
}