Q: php 5.6.16 -Curl request for file upload Currently I am using Php 5.2 version.
Below code is working fine on older version 
$ch = curl_init();
            if(isset($file['image']) || isset($file['image1']))
            {   

                if(isset($file['image']) && $file['image']['error'] == 0)
                {
                $filename = $file['image']['name'];
                $filedata = $file['image']['tmp_name'];
                $filesize = $file['image']['size'];
                }
                elseif(isset($file['image1']) && $file['image1']['error'] == 0)
                { 
                    $filename = $file['image1']['name'];
                    $filedata = $file['image1']['tmp_name'];
                    $filesize = $file['image1']['size'];                    
                }
                else
                {
                    if(isset($post['nonJSAddProduct']) && $post['nonJSAddProduct'] == 'Y'){
                        return "not uploaded";
                    }else{
                        echo "not uploaded";die;
                    }
                }
            }
            if(isset($post['filenme_final']) && $post['filenme_final'] !='')
                $post['imagename']=$post['filenme_final'];
            else
            $post['imagename']=$filename;

            $post['image']="@$filedata";
            $headers = array("Content-Type:multipart/form-data");
                if ($_SERVER["HTTP_X_FORWARDED_SERVER"] == 'dev-m.indiamart.com' )
                {  
                     curl_setopt($ch, CURLOPT_URL, 'http://dev-mapi.indiamart.com/wservce/products/uploadimage/');
                }

                if ($_SERVER["HTTP_X_FORWARDED_SERVER"] == 'dev-m.indiamart.com' || $_SERVER["HTTP_X_FORWARDED_SERVER"] == 'stg-m.indiamart.com')
                curl_setopt($ch, CURLOPT_USERPWD, "admin:admin");                
                $options = array(
                    //CURLOPT_HEADER => true,//if we remove it then it not prints extra data like 200 ok
                    CURLOPT_POST => 1,
                    CURLOPT_HTTPHEADER => $headers,
                    CURLOPT_POSTFIELDS => $post,
                    CURLOPT_INFILESIZE => $filesize,
                    CURLOPT_RETURNTRANSFER => true
                ); // cURL options
                curl_setopt_array($ch, $options);
                $response = curl_exec($ch);  
                curl_close($ch);

                  $dataProvider = (array) json_decode($response, true);
                  return $dataProvider;

Now We are migrating to php 5.6.16 but when I am running the same code on new version i.e. 5.6.16 ,On api end when I am printing $_FILES array, I am getting blank .
Please help,where is the error in this code 
