title: upload a file using FTP and php
body: <p>I can't Upload the file using php because i can't send the path i got from the html file to the function FTP_PUT because it only takes string "test.txt" </p>
  
  <p>How Can i send the Path to this function</p>
  
  <p>PHP FILE </p>
  
  <pre><code>$file = $_POST["file"];
  
  // upload file
  if (ftp_put($ftp_conn, $file, $file, FTP_BINARY))
    {
    echo "Successfully uploaded $file.";
    }
  else
    {
    echo "Error uploading $file.";
    }
  
  // close connection
  ftp_close($ftp_conn);
  </code></pre>
  
  <p>HTML FILE </p>
  
  <p>    </p>
  
  <pre><code>&lt;div class="container"&gt;
   
            &lt;div class="row"&gt;
              &lt;div class="col-lg-12"&gt;
                 &lt;form class="well" action="Upload.php" method="post" &gt;
                    &lt;div class="form-group"&gt;
                      &lt;label for="file"&gt;Select a file to upload&lt;/label&gt;
                      &lt;input type="file" name="file" id="file"&gt;
  
                     &lt;!-- &lt;p class="help-block"&gt;Only jpg,jpeg,png and gif file with maximum size of 1 MB is allowed.&lt;/p&gt; --&gt;
                    &lt;/div&gt;
                    &lt;input type="submit" class="btn btn-lg btn-primary" value="Upload"&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
            &lt;/div&gt;
      &lt;/div&gt; 
  </code></pre>