title: Uploading url file to remote server using curl
body: <p>I've been on this for 3 days now but I can't seem to resolve it, the user will input the url and the system will upload it on remote server.. this is what I've done so far</p>
  
  <pre><code>$POST_DATA = array(
      'file' =&gt; '@'.  'http://images.visitcanberra.com.au/images/canberra_hero_image.jpg',
      'extension' =&gt; 'txt',
      'filename' =&gt; 'test',
      'directory' =&gt; 'uploads/'
  );
  
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, 'http://1234.4321.67.11/upload.php');
  curl_setopt($curl, CURLOPT_TIMEOUT, 30);
  curl_setopt($curl, CURLOPT_POST, 1);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $POST_DATA);
  $response = curl_exec($curl);
  
  curl_close ($curl);
  </code></pre>