Files directory upload from js sdk issue

binary as been encode to base64
content type to multipart/form-data

error 8002 .
its a progress . my code as the guide :

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, ‘http://api.backendless.com/519D3627-53FA-5FD5-FF77-E3BB5B7F6900/FD09A50B-5126-6998-FFF6-2F14302CD300/files/binary/testfolder/save1.png?overwrite=true’);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘PUT’);

curl_setopt($ch, CURLOPT_POSTFIELDS, $image);

$headers = array();
//$headers[] = ‘Application-Id: 519D3627-53FA-5FD5-FF77-E3BB5B7F6900’;
//$headers[] = ‘Secret-Key: FD09A50B-5126-6998-FFF6-2F14302CD300’;
//$headers[] = ‘Content-Type: text/plain’;
$headers[] = ‘Content-Type: multipart/form-data’;

$headers[] = ‘Application-Type: REST’;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
echo ‘Error:’ . curl_error($ch);
}
curl_close($ch);

echo $result;