I am sending multiple file of form to server but it show error like this:-
$post_params['files'][] =
'@' . $this->fields['files']['tmp_name'][$index]
. ';filename=' . $this->fields['files']['name'][$index]
. ';type=' . $this->fields['files']['type'][$index];
}
//print_r($post_params); die;
// We send XML via CURL using POST with a http header of text/xml.
$url = "http://54.221.28.145:8080/kv_image_rest_service/rest/files/upload";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ch_result = curl_exec($ch);
curl_close($ch);
// Print CURL result.
echo $ch_result;
</div>