title: http file upload using cURL in linux(command line)
body: <p>I have to upload the file in my local system using the <strong>CURL</strong> HTTP POST in linux command line.</p>
  
  <p>I have used these commands, with no success:</p>
  
  <pre><code>curl -F "image=@/var/www/fbapp/images/registration.png" http://localhost/xmlcreate/curlupload.php
  
  curl --form "fileupload=@/var/www/fbapp/images/registration.png" http://localhost/xmlcreate/curlupload.php
  
  curl -X POST -d @/var/www/fbapp/images/registration.png http://localhost/xmlcreate/curlupload.php
  
  curl --data-binary @/var/www/fbapp/images/registration.png http://localhost/xmlcreate/curlupload.php
  </code></pre>
  
  <p>I used all these commands but none of these worked.</p>
  
  <p>Here is my <strong>PHP</strong> file where I'm trying to get the uploaded file(using curl) and save it in some other directory:</p>
  
  <pre><code>&lt;?php
  $uploadpath = "images/";
  $filedata = $_FILES['image']['tmp_name'];
  $filename = $_POST['filename'];
  if ($filedata != '' &amp;&amp; $filename != '')
      copy($filedata,$uploadpath.$filename);
  ?&gt;
  </code></pre>
  
  <p>Can someone please help me with this. I'm stuck here and not able to go forward.</p>
  
  <p>Once it starts working on the local I have to use the remote server URL, instead of the localhost.</p>