title: upload file via curl
body: <p>I try to upload file via curl in php,
  this is my sample code</p>
  
  <pre><code>set_time_limit(0);
  $url = 'http://localhost/curltest/upload.php';
  $field_name = 'file'; 
  if (isset($_FILES['file']))
  {
  $ch = curl_init($url);
  curl_setopt($ch,CURLOPT_POSTFIELDS,array("$field_name"=&gt;"@".$_FILES['file']['tmp_name']));
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $result = curl_exec($ch);
  curl_close($ch);
  echo $result;
  }
  </code></pre>
  
  <p>I set permission to 777,but it doesn't work.
  where is the problem?
  (it doesn't show any result)</p>