title: Upload File To Remote Server With PHP cURL
body: <p>I would like to transfer a file from a web site to this web site gulfup.com using <code>POST</code></p>
  
  <p>MY CODE ( it contain a problem that no file uploaded ) :</p>
  
  <pre><code>&lt;?php
  
  $the_file = "http://downloads.wordpress.org/plugin/wp-super-cache.1.2.zip";
  
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_VERBOSE, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
  curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux i686; rv:6.0) Gecko/20100101 Firefox/6.0Mozilla/4.0 (compatible;)");
  curl_setopt($ch, CURLOPT_URL, 'http://www.gulfup.com/index.php');
  curl_setopt($ch, CURLOPT_POST, true);
  $post = array(
      'file_1_' =&gt; "$the_file"
  );
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  $response = curl_exec($ch);
  if(curl_errno($ch)) {
      echo 'Error: ' . curl_error($ch);
  }
  else {
      echo $response;
  }
  
  ?&gt;
  </code></pre>
  
  <p>web site code to upload from pc : </p>
  
  <pre><code>&lt;form id="uploader" name="uploader" action="http://www.gulfup.com/index.php" method="post" enctype="multipart/form-data" onsubmit="form_submit();"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_1_" id="file_1_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_1_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_2_" id="file_2_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_2_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_3_" id="file_3_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_3_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_4_" id="file_4_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_4_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_5_" id="file_5_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_5_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_6_" id="file_6_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_6_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_7_" id="file_7_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_7_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_8_" id="file_8_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_8_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_9_" id="file_9_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_9_"&gt;
  &lt;div class="uploadfile"&gt;&lt;input name="file_10_" id="file_10_" size="70" type="file"&gt;&lt;/div&gt;
  &lt;br id="br_10_"&gt;
  &lt;br&gt;
  
  &lt;span class="bn_up"&gt;&lt;button type="submit" name="submitr" class="btn" id="submitr"&gt;&lt;span&gt;Upload&lt;/span&gt;&lt;/button&gt;&lt;/span&gt;
  
  &lt;div class="clr"&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>What is the problem in my code?</p>