title: Upload a photo to remote server PHP
body: <p>I want to upload a file to a remote which can be downloaded from a url. Below is the code that I used to do that, but the $response that I get says that file is not received in the server end.</p>
  
  <pre><code>$path = "http://image-server/image.jpg";
  
  $ch=curl_init();
  
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  
  curl_setopt($ch,CURLOPT_URL,"https://my-server/files/images");
  
  curl_setopt($ch,CURLOPT_POST,true);
  
  $post=array("content"=&gt;$path);
  
  curl_setopt($ch,CURLOPT_POSTFIELDS,$post);
  
  $response=curl_exec($ch);
  </code></pre>
  
  <p>FYI : the file needs to be sent as the value for a parameter(content).</p>
  
  <p>Thanks.</p>