title: Warning: ftp_put() expects parameter 3 to be a valid path, array given
body: <p>I'm trying to upload a single file to my ftp directory but unable to upload the file.   I keep getting the following error </p>
  
  <p>Warning: ftp_put() expects parameter 3 to be a valid path, array given</p>
  
  <pre><code>&lt;form action="" class="tsc_form_contact_light frame tbar" method='post' enctype="multipart/form-data"&gt;       
      &lt;label for="name"&gt;ArtWork Name &lt;font color='red'&gt;(required)&lt;/font&gt;&lt;/label&gt;   
      &lt;input type="upload" name="artname" class="form-input" required /&gt;
      &lt;label for="name"&gt;ArtWork Image&lt;/label&gt;     
      &lt;input type="file" id="uploadfile" name="uploadfile"&gt; 
      &lt;/form&gt;
  
      $path_of_storage = '/public_html/newinvoice/orderimage/';
      $newftpdir = $_SESSION['SESS_ORDER_ID'];
  
      $conn_id = ftp_connect($ftpserver);
      ftp_pasv($conn_id, true); 
      $login_result = ftp_login($conn_id, $ftplogin, $ftppass);
  
      //ftp_mksubdirs($conn_id,$path_of_storage,$newftpdir);
  
              $source_file = $_FILES['uploadfile']['tmp_name'];
          $destination_file = "$path_of_storage".$source_file;
          $destination = "$path_of_storage";          
  
              // check connection
              if ((!$conn_id) || (!$login_result)) { 
                  echo "FTP connection has failed!";
                  exit; 
              } else {
                  echo "Connected";
              }
  
              // upload the file
              $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); 
  
              $name = $_FILES["uploadfile"]["name"];
              move_uploaded_file($source_file, "$destination/$name");
  
      // check upload status
      if (!$upload) { 
      echo "FTP upload has failed! $destination_file";
      } else {
      echo "Uploaded $source_file as $destination_file";
      }
  
      // close the FTP stream 
      ftp_close($conn_id);
  </code></pre>