i am trying to upload file using curl but if two file are trying to upload then its upload same file twise .
ch_thumb = curl_init();
curl_setopt($ch_thumb, CURLOPT_URL, $url);
curl_setopt($ch_thumb, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch_thumb, CURLOPT_SSL_VERIFYPEER, false);
$fname = $file_name;
$data->$fname = new CURLFile ('images/'.$fname);
curl_setopt($ch_thumb, CURLOPT_SAFE_UPLOAD, true);
curl_setopt($ch_thumb, CURLOPT_POSTFIELDS, $data);
$resp = curl_exec($ch_thumb);
clearstatcache();
curl_close($ch_thumb);
please provide solution for that how can i solve.