title: Send File to HTTPS URL using CURL and PHP
body: <p>I am attempting to send a file to an Https URL with this code:</p>
  
  <pre><code>$file_to_upload = array('file_contents'=&gt;'@'.$target_path); 
  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_URL, $target_url); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt($ch, CURLOPT_RETURNTRANSER, FALSE);
  curl_setopt($ch, CURLOPT_UPLOAD, TRUE);
  curl_setopt($ch, CURLOPT_POST,1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, 'file='.$file_to_upload); 
  $result = curl_exec($ch); 
  $error = curl_error($ch);
  curl_close ($ch); 
  echo " Server response: ".$result; 
  echo " Curl Error: ".$error;
  </code></pre>
  
  <p>But for some reason I'm getting this response:</p>
  
  <pre><code>Curl Error: Failed to open/read local data from file/application
  </code></pre>
  
  <p>Any advice would help thanks!</p>
  
  <p>UPDATE: When I take out CURLOPT_UPLOAD, I get a response from the target server but it says that there was no file in the payload</p>