title: Upload file using Curl and receive them in Laravel method
body: <p>I have been trying to upload file to using curl using laravel app end point.</p>
  
  <p>Below code is on separate server.</p>
  
  <pre><code>$header = $this-&gt;getCurlHeader();
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL,$this-&gt;url);
  curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
  // curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);   
  $cfile = new \CURLFile($this-&gt;filePath . $this-&gt;csvFile,  'text/csv','text.csv');
  //print_r($cfile);exit;
  $postData = array('csv' =&gt; $cfile);         
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);                    
  curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
  //curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  $response = curl_exec($ch);
  $hhtpCode = curl_getinfo($ch);
  curl_close($ch);
  //$this-&gt;dbg($hhtpCode);
  $this-&gt;dbg(json_decode($response,1),1);
  </code></pre>
  
  <p>And receiving end in laravel app hosted on different server.</p>
  
  <pre><code>public function insert(Request $request, $feed=''){
       //return response()-&gt;json(var_dump($request-&gt;all()));
       //return response()-&gt;json("here in insert");
       return response()-&gt;json($_FILES);
       echo "here";
       dd($_FILES);
  }
  </code></pre>
  
  <p>It returns me empty response.
  I am able to verify curl request using headers.</p>
  
  <p>Any suggestion will be helpful.
  Thanks.</p>