I'm using PHP Version 5.3.3-7+squeeze19 (At work).
I'm trying to POST a file using cURL but the response of the server is "false, file no received". This make me think that I'm writing the correct cURL code but is not sending the file.
private static function sendPostRequestTest(){
$url = "http://devapi.xxxx.com/vx/uploadFile/xx/xx-xx-xxx?authToken=brbfgkw33d3d3d3";
$file_name_with_full_path = realpath('data/fileTest.jpeg');
$post = array('file'=>'@'.$file_name_with_full_path);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result=curl_exec ($ch);
curl_close ($ch);
}
I've been searching for a week and I can't find any reason why is not sending the file. The path is correct (I guess) because I did verify it using file_exist function.